Tuesday, 31 July 2012

JQUERY toggle between two classes

It's so simple... so elegant:

$(".portlet-header").toggleClass("ui-icon-plus").toggleClass("ui-icon-minus");

What is so hard to understand you toggle both the classes and let Jquery figure out the rest. 
CREDIT TO:
http://stackoverflow.com/questions/1644545/toggle-between-two-classes-in-jquery#7886070

0 comments:

Post a Comment