简体   繁体   中英

Run jQuery code once document is ready AND iframe content is loaded

I'm experiencing issues with layout of my website as I am running some jQuery that gets applied once content is loaded / document is ready. However, it appears that because iframe content gets loaded in after document is ready plugin gets applied before that and screws up some layout of the website. Is there a method to only execute jQuery code once document is ready AND iframe content is loaded?

As iframe is generated by some plugin in wordpress I have little control and can't give it class name nor id. If you need to access it you can do so, like this: .post-comments iframe

$(document).ready(function(){
    $.holdReady(true);
    //init plugin
    $.holdReady(false);
    //other code
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM