On May 15, 11:35 am, Calvin <cstephe...@gmail.com> wrote: > Hi, > > I was able to get this script to work and was wondering if there was > a better/proper/more efficient way of writing it. Here is the script: > > $(document).ready(function() { > $('li.a').hover(function() { > $(this).addClass('move'); > }); > $('li.a').mouseLeave(function() { > $(this).removeClass('move'); > )}; > )}; Use the CSS a:hover pseudo-class and set your style rules there, no script required. li a:hover { /* insert rules */ } <URL: http://www.w3.org/TR/CSS2/selector.html#x32 > -- Rob
- [jQuery] A better way of writing this cod... Calvin
- [jQuery] Re: A better way of writing... James
- [jQuery] Re: A better way of wri... James
- [jQuery] Re: A better way of... Calvin Stephens
- [jQuery] Re: A better way of writing... RobG
- [jQuery] Re: A better way of wri... Karthikraj
- [jQuery] Re: A better way of... waseem sabjee
- [jQuery] Re: A better way of... Jonathan Vanherpe (T & T NV)
- [jQuery] Re: A better way of... RobG
- [jQuery] Re: A better wa... ryan.j
- [jQuery] Re: A bett... Vincent Robert
- [jQuery] Re: A better way of writing... Jthomas
- [jQuery] Re: A better way of wri... benoit v.