Friday, June 27, 2008

Totally Random

Well not really random - this is what I do for a living but I just cannot get this to work right and I don't know where I'm going wrong.

I want to make an image sprite using CSS. I've created the image I want - which is only an enabled state of a icon, and a disabled state and I want to show one or the other. I cannot get the stupid thing to work right. I found some tutorials on the web, but most of them assume I want to have an icon and a rollover state and that's not what I want. I know I will need javascript to test whether or not the button should be enabled/disabled - that is fine - it's just getting the 2 states to show up correctly I can't get to work.

I know the engineers can figure this out, but as the UI Designer I would like to hand off something that actually works right and they can use it (or not), but at least I got it right. ARGH! Help!


jmr76 said...

And you didn't bother asking me? I'm so sad!

Are you looking for javascript to toggle the image between enabled and disabled styles without knowing what the initial state of the image is? Are you using inline styles on the image or different classes for each state?

DJDiva said...

No no! I would ask you!!! I feel bad I'm always bombarding you with JavaScript/CSS questions though so I was trying to be kind!! Trust me you are always the first person I think of when I have these issues!!

I have for example an Add content button. It will be enabled for most users, but if you are a guest to the community will be disabled until you log in. So I want to toggle between the two states.

I have one image that is 44 x 22 px. Each icon is 22 x 22.

I was going to use 2 different classes? But maybe that isn't the way to go?