Toggle Two Classes in Jquery - Best way |
$("#TriggerElement").toggle(function()
{
$('#TargerElement').removeClass("FirstClass").addClass("SecondClass");
}, function() {
$('#TargerElement').removeClass("SecondClass").addClass("FirstClass");
});
$('#TriggerElement').click(function(){ $('#TargerElement').toggleClass('FirstClass','SecondClass'); });
0 comments:
Post a Comment