jQuery outerHeight is not working when reattaching an element
I create div containing an image and attach it to an iframe.To determine the height iframe with the div, I use the jQuery.outerHeight on the div by atta开发者_JS百科ching it the body. The first time I do it, it returns the correct value. But when I remove this div from iframe and try to reattach it the another iframe again, jQuery.outerHeight doesn't work again. It doesn't calculate the padding of the div.
I understand, it is because JavaScript handles the frame to a full load of all elements of the frame. I placed an event:
$(window).load(function() {
//here is cod
});
Wild guess: jQuery can't measure something if it is not visible. Are you sure the element is visible when you reattach it?
精彩评论