Excellent Ariel!  Thank you.  Just one issue I think you had one
extra } in there, but this worked perfect for me!  Thank you very
much!
Vallard

On May 27, 12:23 pm, Ariel Flesler <[EMAIL PROTECTED]> wrote:
> $(document).ready(function(){
>    $('#home, #contact, #gallery, #about').hover(
>         function(){
>             $(this).stop().animate({marginTop: "-5px"});
>         },
>         function(){
>             $(this).stop().animate({marginTop: "0px"});
>         }
>     });
>
> });
>
> You can use a class selector instead of the ids.
>
> --
> Ariel Fleslerhttp://flesler.blogspot.com
>
> On 27 mayo, 14:13, Vallard <[EMAIL PROTECTED]> wrote:
>
> > I'm trying to run the following code:
>
> > var nav = [ "#home", "#contact", "#gallery", "#about" ];
> > $(document).ready(function(){
> >     for(var i = 0; i < nav.length; i++){
> >         $(nav[i]).mouseover(function(){
> >             $(nav[i]).animate({
> >                 marginTop: "-5px"
> >             });
> >         });
> >         $(nav[i]).mouseout(function(){
> >             $(nav[i]).animate({
> >                 marginTop: "0px"
> >             });
> >         });
> >     }
>
> > });
>
> > however, those effects never get added.  If I don't do the for loop
> > and do each item individually it works fine.  Do I just have a dumb
> > bug in here?
>
> > Thanks for any help, and thanks for developing this great lib.

Reply via email to