私は内部サイトで作業しており、Google の API を外部呼び出して setOnLoadCallback() 関数を使用することはできず、ローカルで呼び出された JQuery で使用できる純粋な JQuery の代替手段が見つからないようです。参考までに、実装しようとしているコードは次のとおりですが、元の開発者は Google API を使用して記述しています。
<script type="text/javascript">
google.load("jquery", "1.3.2");
google.load("jqueryui", "1.7.2");
google.setOnLoadCallback(function() {
var timeout = null;
var initialMargin = parseInt($("#siteMenuBar").css("margin-top"));
$("#siteMenuBar").hover(
function() {
if (timeout) {
clearTimeout(timeout);
timeout = null;
}
$(this).animate({ marginTop: 0 }, 'fast');
},
function() {
var menuBar = $(this);
timeout = setTimeout(function() {
timeout = null;
menuBar.animate({ marginTop: initialMargin }, 'slow');
}, 1000);
}
);
});
</script>
任意の提案/アイデアをいただければ幸いです。