jquery - Changing css w/ javascript -


so have link, when clicked, want css values change. can jquery code:

    $(".linkname").click(function(){   $(this).css({'border-style' : 'solid', 'border-width' : '1px', 'border-color' : '#ec6163', 'color' : '#ec6163'});   return false; }); 

however, want link's css values revert normal when click link altered css values second time. tried if else sentence, evaluated else , didn't work. how can this?

even better, put of css class , use toggleclass switch.

/* css */ .someclass { border: 1px solid #ec6163; color: #ec6163; }  /* js */ $(".linkname").click(function(){     $(this).toggleclass('someclass');     return false; }); 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -