jQuery scroll to increments

Posted on 2009-07-06
Last Modified: 2012-05-07
This is a rather simple concept, Im not sure how to correctly code it.

Any help asap is greatly appreciated.

Using the jQuery code below, I am scrolling a div, and that works great.

How does one do this incrementally? Meaning pressing the #next_item will jump another 148 pixels, and continue each click.


		$('#itinerary_items').stop().scrollTo( 148, 300 );



Open in new window

Question by:webrhp
LVL 82

Accepted Solution

hielo earned 500 total points
ID: 24789391

var lastValue=0;





                $('#itinerary_items').stop().scrollTo( lastValue, 300 );





Open in new window


Expert Comment

ID: 24790402
This one has all you need Check relative position or offset method.


Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

DOM Attributes and Properties treatment with jQuery 1.6 by Ivo Stoykov jQuery ( 1.6 introduces .prop() ( and .removeProp() ( methods which allow modifying or removi…
In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now