开发者

JQuery Toggle image AND another div height

开发者 https://www.devze.com 2023-01-08 11:14 出处:网络
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 incr

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
    }
  });
});
0

精彩评论

暂无评论...
验证码 换一张
取 消