I believe your CSS is invalid. I don't think you can apply both a class AND
an ID in the same selector which is what #base-state.active does. Now
#base-state:active might work as that's a pseudo class.

-----Original Message-----
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of ButtersRugby
Sent: Friday, May 22, 2009 1:25 PM
To: jQuery (English)
Subject: [jQuery] Re: Rollover Effects instead of alternate images


I just did this the other day on a web page.
You need to make an image that has both the active, and regular state images
in it.

Then in your css,

#base-state {background-position: 0px 0px;}   // The first 0 is the X
axis position, the second is the Y
#base-state.active {background-position: 0px 30px;} // This is our second
class that we will switch to with our jquery

Javascript --

$(document).ready(function() {
  $("#base-state").click(function() {
      $(this).toggleClass("active");
      }
   )
});

Just a basic run through of how it works.
I don't know how much help that is..
I probably goofed something up there, but it's the gist..


Reply via email to