このWordpressテーマの開発を終えたところです:http: //www.minnesdiner.com/
すべてがうまく機能していますが、ナビゲーションに100%満足しているわけではありません。スライド位置インジケーターはスムーズに機能しますが、ホバーインテントjQueryプラグインを統合して、ユーザーが意図せずにナビゲーションを通過したときにスライドインジケーターがスライドしないようにしたいと思います。
このプラグインを統合する方法について何かアイデアはありますか?現在、ナビゲーションアイテムごとに個別のjQuery関数を起動し、ホバーされているアイテムに基づいてスライディングインジケーターに座標を渡します。
これが私の現在のjQueryコードです:
$(document).ready(function() {
var $currentpos = $("#menu-indicator").css("left");
$("#menu-indicator").data('storedpos', $currentpos);
$(".current-menu-item").mouseenter(function () {
$("#menu-indicator").stop().animate({left: $currentpos}, 150);
});
$(".menu-item-26").delay(500).mouseenter(function () {
$("#menu-indicator").stop().animate({left: "52px"}, 150);
});
$(".menu-item-121").mouseenter(function () {
$("#menu-indicator").stop().animate({left: "180px"}, 150);
});
$(".menu-item-29").mouseenter(function () {
$("#menu-indicator").stop().animate({left: "310px"}, 150);
});
$(".menu-item-55").mouseenter(function () {
$("#menu-indicator").stop().animate({left: "440px"}, 150);
});
$(".menu-item-27").mouseenter(function () {
$("#menu-indicator").stop().animate({left: "570px"}, 150);
});
$(".menu-item-164").mouseenter(function () {
$("#menu-indicator").stop().animate({left: "760px"}, 150);
});
$delayamt = 400;
$("#header-row2").click(function () {
$delayamt = 5000;
});
$("#header-row2").mouseleave(function () {
$("#menu-indicator").stop().delay($delayamt).animate({left: $currentpos}, 600);
});
});
ご覧のとおり、mousoverとmouseoutを別々の要素(list-itemと含むdiv)にバインドする必要があります。
ありがとう!