I am looking for something similar to jQuery image lazy load plugin, but for iframe
s.
相关问题
- Angular RxJS mergeMap types
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- How to fix IE ClearType + jQuery opacity problem i
- void before promise syntax
You could always intialize the src attribute to about:blank and then when your click event fires, set the src attribute to the URL you want to navigate to.
If you want to do this in WordPress
Here is an automatic, request reducing, solution
In WordPress plugin form
Here is a WordPress plugin you can download and manually install via the WordPress plugin repository. I created this today just to handle this situation. No changes to content are needed, this works automatically once activated on any and all iframes.
https://wordpress.org/plugins/lowermedia-iframes-on-demand/
Can you set the src to about:blank? Like this?
http://jsfiddle.net/MaUfH/
A similar question was recently posted specific to iFrames with Twitter Bootstrap-based tabs, which I answered using a technique I'm calling Lazy Loading of iFrames. The js/jquery is as follows; see the full code including html markup in the fiddle or on my response to the OP:
This worked for me.
jsFiddle.