0
I have the following problem. am using . load to perform an action after loading an iframe
$(document).ready(function() {
$('iframe').on('load',function()
{
$('#diviframe').fadeTo(200,1);
});
});
Everything works great, except if the iframe loads before the code. I came to this conclusion because I tested with iframe with only one word (to load faster) and several texts (to take a little longer to load). someone has some idea how to solve this?
Thanks for the reply, but although I have not specified, the code is already ready. Iframe is required as the goal is to upload without refresh. From the tests I’ve done, I believe it’s the iframe that’s being loaded before the code, because only it doesn’t work when the iframe loads too fast.
– user13345
Ok. So maybe you should do the following: Remove the code from the page that includes the iframe and put $(#diviframe). fadeTo(200,1); within a $(Document). ready in the iframe’s own view (page). So your code only depends on the iframe.
– Luís Cruz