Will
$(document).ready
in parent page wait for iframe content to be loaded completely?
I have a parent page in which there is a an iFrame. After the iFrame is completely loaded I need to invoke a function in the iFrame from the parent page.
See jQuery .ready in a dynamically inserted iframe
I've been the whole day breaking my balls to find this, I needed it for the work.
Finally I've made my thing (A website with an iframe that loads the content of the links. All i wanted to do was to scroll the page to the top, with a button inside the iframe And it seemed to be wizards work)
Well, that's what I did:
$(document).ready(function () {
$('ifram#IframeID').load(function () { //The function below executes once the iframe has finished loading<---true dat, althoug Is coppypasta from I don't know where
var varStoresNameIframe =$('iframe#IframeID').contents().find('.buttonsClass');
$(varStoresNameIframe).click (function () {
$('html , body').animate({ scrollTop: 0 }, 'slow');
});
});
});
Related link:
So the masterkey for me was the line:
$('ifram#IframeID').load(function () {
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With