Just subtract the scrolled pixels using jQuerys scrollTop
(API) on #leftnav
like this:
$('#leftnavHover').text(this.title).css('top', this.offsetTop - $('#leftnav').scrollTop());
题
My problem is that after scrolling in the #leftnav
the #leftnavHover
does not position itself according to the new top
css value. I need the #leftnavHover
div to follow in the same way the native title text for the browser does.
Here's a fiddle http://jsfiddle.net/fauverism/b4rwb/6/
Here's a step by step of what I'm describing...
Here are some details...
Yes I know that this does seem strange to do since browsers handle this functionality just fine. It's a Chromium issue.
解决方案
Just subtract the scrolled pixels using jQuerys scrollTop
(API) on #leftnav
like this:
$('#leftnavHover').text(this.title).css('top', this.offsetTop - $('#leftnav').scrollTop());