Here is my code:
$(document).ready(function() {
var interval = setInterval("change_height()", 500);
var height;
function change_height() {
height = parseInt(window.location.hash);
$('#message_body').height(height);
alert("");
clearInterval(interval);
}
});
for some reason the change_height() function just isn’t being called yet it works if I put it outside the document.ready block but then the clearInterval doesn’t work!
Any help much appreciated.
Thanks
setInterval is a native javascript function and not a jQuery function.
With that cleared up, try just referencing the function directly using:
This is better than letting the setInterval function interpret the string.