让Lavalamp jQuery插件与下拉菜单一起使用?

我有一个jQuery Lavalamp插件的问题。 它与单级菜单完美配合,但在添加下拉列表后,它会有点丢失。 这就是我的意思: http : //screenr.com/0fS 。

当然,我想要实现的是,当用户将鼠标hover在子项目上时,lavalamp背景将保留在Portfolio项目上。

我想这是一个稍微改变插件的问题,所以这里是插件的完整代码。 所需要的只是一种简单的方法,让lavalamp在当前阶段停止,当

  • 的孩子们徘徊,然后恢复正常工作。 这是完整的插件代码供参考!

     (function($) { $.fn.lavaLamp = function(o) { o = $.extend({ fx: "linear", speed: 500, click: function(){} }, o || {}); return this.each(function() { var me = $(this), noop = function(){}, $back = $('
  • ').appendTo(me), $li = $("li", this), curr = $("li.current", this)[0] || $($li[0]).addClass("current")[0]; $li.not(".back").hover(function() { move(this); }, noop); $(this).hover(noop, function() { move(curr); }); $li.click(function(e) { setCurr(this); return o.click.apply(this, [e, this]); }); setCurr(curr); function setCurr(el) { $back.css({ "left": el.offsetLeft+"px", "width": el.offsetWidth+"px" }); curr = el; }; function move(el) { $back.each(function() { $(this).dequeue(); } ).animate({ width: el.offsetWidth, left: el.offsetLeft }, o.speed, o.fx); }; }); }; })(jQuery);`

    提前致谢。

    解决这个问题的方法是将lavalamp中的hover()更改为mouseover,如下页所示。

    http://hekimian-williams.com/?p=146

    我在顶级li中添加了额外的类并更新了js:

     $li = $("li.top-level-item", this),