Aug
3
3
Tip#3 Animating the scrollbar with jQuery
There is a bit of shadows when animating the scrollbar with jQuery, what should you animate? Well the response is simple, the scrollTop.
So for example, if you want to slide the scrollbar to an element in particular, this is really easy, you would do:
-
// the :not:animated is just a protection
-
var destination = $("#ID").offset().top;
-
$("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination});
It will slllllliiiiiiddddeeee.
Leave a comment
Articles
Some Tweets
- Confoo schedule is out! my talk, jquery spaghetti, will be thursday 13:30! Right after lunch!
- The Open Web Needs You Now http://t.co/KclGKezj
- jquery validation engine 2.5.1 release is coming, some bugfixs in there, you can already grab it from github raw download
- really nice backbone patterns resource, http://t.co/FQLYcoZV
- the best news reader app for android tablet @pulsepad , a joy to read on, no need for all those websites app now..
- Interestingly enough, my fellow developers that had a looked at @weddingdeck app stayed longer than my wedding clients target userbase








