javascript - Release toggle effect when clicking on another link -


i have javascript causes link change background color when clicked:

$(".button").click(function(){      $(this).css('background-color', '#555'); }); 

and works, color toggle off when click on link.

you can this

$(function() {   $(".button").click(function() {     $(this).css('background-color', '#555');     $(".button").not($(this)).css('background-color', '');    }); }); 

jsfiddle


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -