So I want a div (#more) to change its height from 105px to 25px once another div (#clck) was clicked. I kind of did it with:
<script type="text/javascript">
$("#clck").click(function () {
$("#more").css("height", "325");
});
</script>
but after the first click, it doesn’t go back to its initial height. I’ve tried toggleClass but it’s not working.
Can anybody help me do this?
Try setting the height in a new CSS-class and toggle this class using toggleClass.
Example:
HTML:
CSS:
JS: