andrea--thanks so much for this helpful tip.  I get the positioning
and overflow stuff, but I'm unclear on the 'li:eq(' + n + ')' syntax--
I would have expected some form of .each perhaps with an incrementing
variable to use as the "multiplier" for determining the top value for
each <li>.  If I read this correctly, it looks like the callback on
the animate function is recursing until the end of the <li>s?  I'll
give this a shot and probably learn what this syntax means, but any
clarification would be great.  Thanks again, David

On Feb 13, 8:51 am, andrea varnier <[EMAIL PROTECTED]> wrote:
> On 13 Feb, 06:41,spaceage<[EMAIL PROTECTED]> wrote:
>
> > Is this a reasonable undertaking using jQuery, or is there another
> > better way (or plug in) to do this?
>
> jQuery is perfect for this kind of things :)
> just give the div a overflow:hidden style, and the li's a
> position:relative, and a very high top.
>
> div {
>         overflow:hidden;
>         height:300px;
>         width:250px;
>         border:2px solid black;}
>
> li {
>         position:relative;
>         top:1000px;
>
> }
>
> then you could do the animation with some code like this (this fires
> at page load)
>
> $(document).ready(function(){
>         var spacing = 30;  // arbitrary, change as you please
>         var upLi = function(n) {
>                 $('li:eq(' + n + ')').animate({top: spacing*n}, function(){
>                         if ($('li:eq(' + (n+1) + ')')[0] != undefined) 
> upLi(n+1);
>                 });
>         }
>         upLi(0);
>
> });

Reply via email to