<div id="homePage"
style="position: relative; margin: 0px; width: 320px; height: 420px;">
<img id="userImg" src="images/5.jpg" width="100%"
height="100%" onclick="imageClick()"
style=" z-index: -1; margin: 0px; "/>
</div>
<script type="text/javascript">
$(document).ready(function() {
$('#userImg').css('transform', 'rotate(90deg)');
});
</script>
After rotating the image, it no longer fits within the boundaries of the div. How can I ensure that the rotated image maintains dimensions that fit within the div?
Before Rotation:
After Rotation:
Thank you.