I've been struggling to make a div box expand when clicked and revert to its original size when clicked again. It seems like a simple task, but no matter what I try, I can't seem to get it right. I'm not sure where I'm going wrong, as the problematic part of the code is quite short. Thank you for your help!
https://jsfiddle.net/uL1r08am/
<div id='panelHolder'>
<div id='panel1' class='panels'></div>
</div>
.panels {
position:relative;
border:2px solid silver;
transition:transform 1.5s;
}
.panels:hover {
transform:skewY(3deg);
}
#panel1.clicked{
width:460;
height:290;
}
$('#panel1').on('click', function() {
$(this).toggleClass('clicked');
});
$(document).ready(main)