JQuery Toggle image AND another div height
Not sure if this can be done, but I would like to toggle an image (easy) BUT at the same time increase/decrease the height of another div based on the "open/close" of the toggle. I can get it to increase on click, but not on the "close" any suggestions please
$j('#headerImageToggle').live('click',function(){
$j(this).next('div').slideT开发者_如何学JAVAoggle('slow',function(){
I assume something goes in here?
});
});
$j('#headerImageToggle').live('click',function(){
var nextDiv = $j(this).next('div');
nextDiv.slideToggle('slow',function() {
if (nextDiv.is(':visible')) {
// decrease height
} else {
// increase height
}
});
});
精彩评论