Hi all im working on a little image resize script and it works in ie and ff but not in chrome. I have to refresh the page to get it to work. I am working in an iframe. Heres my code
function resize() {
var maxWidth = 200;
var width = $("#ImageMainPicture").width();
//alert(width);
if (width > maxWidth) {
$("#ImageMainPicture").css("width", maxWidth);
}
This is called on a jquery doc.ready.
Thanks to all who look at this
$(document).ready()runs before the image is loaded. When you need media to be loaded, use$(window).load(instead.Alternatively, just use CSS!