css - Toggle height of div using jQuery -
i trying toggle height of div can vary in height. want toggle 10% of it's original height when user clicks button , 100% when clicked open. need change class of arrow reflect current toggle state. haven't been able nail down second part. whelp appreciated.
here got far...
function togglepracticedrills() { $("#drillhelpslide").animate({height:"10%"}); $(".arrow").addclass("minimized"); };
thanks!
function togglepracticedrills() { var origheight = $('#drillhelpslide').data('origheight'); if (origheight) { $('#drillhelpslide').removedata('origheight'); $('#drillhelpslide').animate({height: origheight}); } else { origheight = $('#drillhelpslide').height(); $('#drillhelpslide').data('origheight', origheight); $('#drillhelpslide').animate({height: origheight * 0.1}); } $(".arrow").addclass("minimized"); };
Comments
Post a Comment