1

I'm currently using this code:

var gallery = $('ul#gallery').children();

$(gallery).filter(':even').not(':last').hover(function () {$(this).toggleClass('next')});

I'm trying to make it fade this new class in. Currently, there's an <li> with an image in it, no background. When the 'next' class is added, it gives it a background image when hovered over. Is there a way to just fade in the new class without making the image blink/fade at all?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
steve
  • 688
  • 6
  • 13
  • 32
  • I don't understand. Are you saying that you want the background image to appear, but have the other attributes of the `next` class animate? – user113716 May 17 '10 at 18:48
  • By the way, `gallery` is already a jQuery object. No need to do `$(gallery).filter(...`. Just do `gallery.filter(...`. – user113716 May 17 '10 at 18:49
  • I took off the $( and everything, thanks. No, not the next li, .next is the class given to this specific list item. I just want whatever
  • that is hovered to fade into class ".next" (which just adds a background image) without affecting what is currently in the
  • and then, if possible, fade the class back out when moused out.
  • – steve May 17 '10 at 18:57