Jump to content

Recommended Posts

You're going about this the wrong way--address the final outcome, not the method to do it.

What you said in your original post is essentially that you want to be able to revert the background color to its original color.

 

The easiest and most direct way to do this is to assign a class to the dom element that you want to attach the color change to.  That's just as simple as using .addclass() and .removeclass() in jQuery and styling the classes appropriately. 

 

Technically to ensure it's good in all browsers now and in the future, you'd want to assign a class in the HTML, then when you want to change the color, add the new class while removing the old one.  When you want to change it back (when the link is clicked in your example) just removed the added class and add back the original one.  Ensure both classes are styled appropriately in your css file and you're good to go.

 

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.