Created
June 8, 2011 01:34
-
-
Save gigamonkey/1013608 to your computer and use it in GitHub Desktop.
Now working jQuery/Javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// #notes is DIV with overflow: scroll and currentParagraph is an element within that DIV. | |
// I'm trying to arrange things so that currentParagraph appears at the top of the DIV. | |
// The trick seems to be to set position: absolute on #notes so it will be the | |
// offsetParent of its elements and then to scroll like this: | |
$('#notes').scrollTop($('#notes').scrollTop() + $(currentParagraph).position().top); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment