I am unsure if this is a “callback’ that I need or not, but basically I am trying to emulate the reversal of the function like on the .hover() effect with the .click() effect. Is this possible. So basically, if the user clicks again on the link, the reverse of what just happened, ie a div closing as opposed to opening, will happen. Is it possible to do this with .click()?
$(document).ready(function(){
$('.content_accrd').css({"height":"0px"});
$('.paneltop').click( function() {
$(this).css({"background-position":"0px -21px"})
.siblings().animate({"height":"100px"}, 200)
}, function() {
$(this).css({"background-position":"0px 0px"})
.siblings().animate({"height":"0px"}, 200);
})
})
Use
.toggle(), not.click().