I think you might be looking for something better than the slideDown()
effect. That isn't quite right as it just increases the height of an object rather than making it appear to "scroll" into view. Check out the show()
effects from jQuery UI. http://jqueryui.com/demos/show/#option-effect I imagine the "Slide" effect would be appropriate if you gave it the option to slide vertically. The "Drop" effect sounds like it would be right, but I get the same effect as "slide" when I try it. Perhaps that is a bug in the demo site at the moment.
You may also be interested in using the animate()
method to animate the top
property of an element so that you can 'scroll' it into view. You'd need to have a container with overflow: hidden
and a set height
and width
with position: relative
set. Then, an inner container with position: absolute
which you can then animate the top
property of with jQuery.animate()
.
var $items = $("#scroller .inner *");
$('#scroller .inner').animate({
top: '-' + Math.round( $items.length * $items.eq(0).outerHeight(true) ) + 'px'
});
Note that if you know how many pixels tall each inner element would be, you could replace the $items.eq(0).outerHeight(true)
with the integer value of the known height.