0

我一直在寻找解决方案,但不幸的是我找不到任何解决方案。

这是关于保持浮动边界。当您指向子菜单的元素时,边框会运行到位置 .active li (取决于哪个页面处于活动状态 - 例如:如果主页正在运行,则“主页”得到类 = 活动)。

如果它停留在指示光标的元素上会很好。

薰衣草灯来源:http://chiroandmelinda.com/jscripts/lavalamp-0.2.0/demo.html

我的代码

//编辑

有没有办法改变“返回”和“移动”功能?

源 - jquery.easing.min.js

4

1 回答 1

1

I fix problem my self :)

Here is my solution If you do not want floating border goes left after you hover some of li elements in your drop menu you must set 'dummy' class for all your main li elements in main ul (not in sub menus!)

E.G. (i use class="mainNav")

<ul>
  <li class="mainNav">Home</li>
  <li class="mainNav">About Us</li>
  <li class="mainNav">Portfolio</li>
    <ul>
      <li>1</li>
      <li>2</li>
    </ul>
  <li class="mainNav">Contact</li>
</ul>

After that you must change some value in jQueryLavaLamp source I mean in jquery.lavalamp.min.js

MAIN FILE

When you look at this code (jquery.lavalamp.min.js) you must search for line 63 which is in original file like that:

$li = $("li", this), curr = $("li.current", this)[0] || $($li[0]).addClass("current")[0];

after you find it just change it to code like this:

$li = $(".mainNav", this), curr = $("li.current", this)[0] || $($li[0]).addClass("current")[0];

i change first $(".li", this) into $(".mainNav", this) after that the crazy floating border (LavaLamp) floating around class="mainNav" elements ONLY! not around li elements :)

Here is some JSFIDDLE

I paste all lavalamp.js code to javascript window to operate directly with main problem element.

You can see i wrote already ".mainNav" in line 9 but you can change it to 'li' and see how is the difference between first and second one. Hope i can help with that :)

于 2013-08-01T01:42:52.473 回答