How do I do the following pseudo code in JQuery?
$(document).ready(function(){
$(".btn-slide").click(function(){
$("#divToSlide").slideToggle("fast");
if ($(this).isToggled) { // <---- DOESN'T WORK -------
// do something when toggled
} else {
// do something different when not toggled
}
});
});
Or you could just use the toggle function: http://api.jquery.com/toggle/
Note: You can have as many toggles as you want, just add more functions:
[EDIT]