Monday, March 22, 2010

jquery toggle effect

To build the UI effect like this, we can extend from the below simple example. Use the 'green' code to hide/ show a section using a button. Use the 'orange' code to toggle the button orientation.

$("#buttonZone").click(function() {
$("#searchDiv").slideToggle(600);

});

$("#buttonZone").toggle(
function() {

$(this).removeClass("buttonZoneHide");
$(this).addClass("buttonZoneShow");

},
function() {

$(this).removeClass("buttonZoneShow");
$(this).addClass("buttonZoneHide");

});

No comments:

Post a Comment