私は ajax 経由で読み込まれるメガ ドロップダウン メニューに取り組んでいます。メニューにホバー インテントを追加したいのですが、.live() とホバー インテントを組み合わせた良い例を見つけることができませんでした。
ホバーを数秒間遅らせて、他のメニューが折りたたまれるのを早めたいと思います。
<script type="text/javascript">
$(document).ready(function(){
$('li.top-nav-links').live('mouseenter', function() {
$(this).find('a.top-nav-link-hover').addClass("top-nav-hover");
$(this).find('div').slideDown(300);
$(this).css('z-index', 9000 );
});
$('li.top-nav-links').live('mouseleave', function() {
$(this).find('div').slideUp(function() {
$(this).siblings('a.top-nav-hover').removeClass("top-nav-hover");
});
$(this).css('z-index', 8000 );
});
});
</script>
注: 基本的に、非表示の div を内部に表示する順序付けられていないリストです。z-index は、最新のホバーされたドロップダウンを一番上に並べ替えます