Mixing jquery dropline and dropdown menu

淺唱寂寞╮ 提交于 2019-12-24 11:14:35

问题


How to achive that following menu act normaly like dropline, but last sublevel to be dropdown instead dropline? Tnx


回答1:


To make sure I understand the question, are you wanting the sub-drop-downs to display in a vertical list instead of horizontally? If so, try adding this to your CSS:

.droplinebar > ul > li > ul > li > ul > li
{
    float: left;
    clear: both;
}

ADDENDUM (to get the menus lined up properly):

I haven't tested this, but see if changing line 16 to the following does the trick:

$subul.css({left:$curobj.position().left, top:this._dimensions.h})

You may need to do something like the above on $targetul as well.

2nd ADDENDUM

It's a bit dirty, but you can always give the sub-ul's a unique id, and them use css to line then up manually.

http://jsfiddle.net/DxpMJ/11/

In that example, I gave a unique id to the JavaScript > Traveling 4 menu, and manually set the margin-left and overrode the width with the !important trick (which you should look up if you're not familiar with it - very useful when javascript plugins are setting CSS styles without your knowledge). If you don't mind manually adding css rules for all of the menus you need to be vertical, I think this would work.



来源:https://stackoverflow.com/questions/6622659/mixing-jquery-dropline-and-dropdown-menu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!