This time I will share jQuery Plugin and tutorial about jQuery Plugin To Load iFrame Content Asynchronously – EasyFrame, hope it will help you in programming stack.
EasyFrame is a jQuery based iFrame enhancement plugin which loads iframe content (Youtube Videos, URLs, Widgets, etc) asynchronously on window load to improve page performance.
How to use it:
1. Include references to jQuery library and the jQuery EasyFrame plugin before the closing body tag.
1 |
< script src = "//code.jquery.com/jquery-2.2.1.min.js" ></ script > |
2 |
< script src = "dist/jquery-easyframe.min.js" ></ script > |
2. Initialize the plugin on document ready and we’re ready to go.
1 |
$( 'iframe' ).easyframe(); |
3. Create an iframe element and specify the address of the document to embed in this iframe using data-src
attribute instead of src
4. You can also specify the document’s address in the JavaScript during initialization.
1 |
$( 'iframe' ).easyframe({ |
5. Specify the timeout which is used to wait after the window loads to instantiate the iframe async loading.
1 |
$( 'iframe' ).easyframe({ |
6. All default options and callback.
1 |
$( 'iframe' ).easyframe({ |
Change log:
2016-03-14
- Changed callback function at all iframe loaded
This awesome jQuery plugin is developed by EmanueleCoppola. For more Advanced Usages, please check the demo page or visit the official website.