簡體   English   中英

使用jQuery的垂直多級彈出菜單中的問題

[英]Issue in vertical multi-level popup menu using jQuery

我正在嘗試開發一個垂直的多級彈出菜單。 我無法將孩子的上衣設置為與其父LI位置相對的位置。 我采用的方法是,我要outerwidth of the UL tag and top of parent LI tag的相應左側和頂部位置計算outerwidth of the UL tag and top of parent LI tag 但這似乎效果不佳。

如果我使用CSS設置left和top,則第一個級別看起來不錯,但對於其余級別,top始終設置為0。

_pm.child.show().css({left:left-2,top:top-1});

如果我使用position函數,則所有級別都顯示為非常接近其父級。

_pm.child.show().position({left:left-2,top:top-1});

我沒有出什么問題。 這是小提琴 有人可以幫我嗎?

通過mouseleave更改mouseout,它將起作用:)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM