onclick - JQUERY Listen for click event -


what i'm looking have container resize onclick.

inside container 2 panels slide down varied heights. need container listen toggle function , resize if needed.

heres code far...

$(document).ready(function() {      var content = $("#content_container");       var childheight = $('.panel-container').height();      if (content < childheight) {         $(content).css("height", 657 + "px");     }      else {         $(content).css("height", "auto");     }  }); 

ps. i'm new jquery!!

you can below, not sure if want can mess around , how want be;

$(document).ready(function() {      $("#content_container").toggle(         function() {             $(this).animate({height: 657}, 200);         },          function() {             $(this).animate({height: 200}, 200);         }     );  }); 

a working example http://jsfiddle.net/carlg/x6ylj/2/


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -