简体   繁体   中英

Tooltip Position Breaking on Scrolling Sidebar

I am trying to achieve a Sidebar with Tooltip attach to its <li> elements like this: Screenshot - Good Tooltip

But whenever I scroll down to the bottom of the sidebar, The Tooltip position is breaking and is not sticking to its <li> element: Screenshot - Bad Tooltip .

Here is the: JSFiddle .

Your Idea and Suggestion would be really appreciated. Thank You!

Your tooltips elements have absolute positioning, with top property related to the body, not to their li parent. On loading, top value is OK, as calculated from the elements flow, but get wrong as you scroll, as it won't change...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM