jquery - scrollTop - weird results -


I have a div that I've coded to scroll "automatically" using scroll down. I am getting some strange results .... Every time I click on the button, the scrolling goes forward and backward. (Please see JSfield, because I'm sure I'm not quite understanding myself, if you can tell me what's going on, and not just how to fix it, I appreciate it. It's set like this: (By the way, on my actual site, I will not have any buttons, I will actually trigger i ++ with keyboard events.) Click (function () {i ++; if ( I & gt; 0) {$ ('# textOne') $ {forest}) .sc RollTop ($ ('$ s3'). Offset (). Top);}}};});

think about offset.Tap means Intuitively, it gives you that the document is the relative top position of that element from the top. So when you click it once the relative height of that element falls below 0 from the top of the document! Do you want to set the scroll head of the div, the difference between the outer divas and tees of the Scrolltop is that the scrollTop of $ ('# s3') element.

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -