I am trying to manage the resizing of a div on my website, but I am encountering a stackoverflow exception when using the resize function. Can someone please help me understand what I am doing wrong?
For reference, here is a jsfiddle example: https://jsfiddle.net/u9q4k4ce/
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script>
function initiate() {
$(document).ready(function () {
$("#divId").off('resize').on('resize', function () {
});
$(window).bind('resize', function () {
$("#divId").resize();
});
});
}
</script>
</head>
<body onload="initiate()">
<div id="divId" style="position:absolute;left:0px;right:0px;top:0px;bottom:0px;"></div>
</body>
</html>
In the jsfiddle example, any window resize triggers a stack overflow. I am using the latest version of Chrome on Windows 7.
Any assistance on this issue would be greatly appreciated.