Hey all,
I've been looking at this for days and it's been driving me crazy. I know it's possible because Isotope/Masonry do it but I'm stumped for getting IE 8 or 7 to not infinite loop on window resize.
This crashes IE as the prepend of a div invokes the window resize event causing an infinite loop.
<!DOCTYPE html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Page Title</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>
$(window).resize(function() {
$('body').prepend('<div>' + $(window).width() + '</div>');
});
</script>
</head>
<body>
</body>
</html>
Any idea?
Thanks,
Sam