Title: Lazy Load
Last modified: August 21, 2016

---

# Lazy Load

 *  Resolved [james@impelmedia.co.uk](https://wordpress.org/support/users/jamesimpelmediacouk/)
 * (@jamesimpelmediacouk)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/lazy-load-4/)
 * Is there a way of lazy loading the modals, so they only load when the link is
   clicked. I have 20 modals and all the content is loading as the page loads. Its
   really slowing my site down
 * [https://wordpress.org/plugins/easy-modal/](https://wordpress.org/plugins/easy-modal/)

Viewing 11 replies - 1 through 11 (of 11 total)

 *  Plugin Author [Daniel Iser](https://wordpress.org/support/users/danieliser/)
 * (@danieliser)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/lazy-load-4/#post-4575836)
 * This is being added in v1.4 but isn’t gonna be ready for release til late march.
 * Do the modals use similar content?
 *  Thread Starter [james@impelmedia.co.uk](https://wordpress.org/support/users/jamesimpelmediacouk/)
 * (@jamesimpelmediacouk)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/lazy-load-4/#post-4575843)
 * Thanks, pretty similar but not exact content. I think its the google map in each
   modal that is causing the issue.
 *  Plugin Author [Daniel Iser](https://wordpress.org/support/users/danieliser/)
 * (@danieliser)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/lazy-load-4/#post-4575855)
 * If you are using a plugin to add the maps we can’t do much about that but if 
   you are adding the code manually you could instead of initializing the maps on
   page load, initialize them when the modal is opened. This would greatly speed
   that up.
 * Also if your using a plugin chances are that Ajax loading the modals will not
   work as most plugins only initialize when the page loads which means the maps
   won’t work either. This is the reason we went away from ajaxing modals in v1 
   because forms and other plugins wouldn’t work properly unless they were preloaded
   in the footer.
 *  Thread Starter [james@impelmedia.co.uk](https://wordpress.org/support/users/jamesimpelmediacouk/)
 * (@jamesimpelmediacouk)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/lazy-load-4/#post-4575871)
 * thanks very much fot you help, I am adding the googmap code to each modal manually.
   Can i be a pain and ask how i could tell the map to load only when the modal 
   is opened. Sorry for my ignorance.
 *  Plugin Author [Daniel Iser](https://wordpress.org/support/users/danieliser/)
 * (@danieliser)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/lazy-load-4/#post-4575884)
 * Not a problem. You can over ride the opening of a modal using JavaScript. Something
   like this should work.
 *     ```
       jQuery('.eModal-1').click(function(e){
           e.preventDefault();
           // do your maps code for this modal
           jQuery('#eModal-1').emodal('open');
       });
       ```
   
 * Since you have so many you could either write a function like this for each or
   write a single function that can detect the modal id and initialize the correct
   map.
 * Let me know of you get stuck.
 *  Thread Starter [james@impelmedia.co.uk](https://wordpress.org/support/users/jamesimpelmediacouk/)
 * (@jamesimpelmediacouk)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/lazy-load-4/#post-4575894)
 * Thanks again, so ijust drop this code in the modal text editor and then drop 
   the iframe code for the map where you comment for it.
 * Thanks
 *  Plugin Author [Daniel Iser](https://wordpress.org/support/users/danieliser/)
 * (@danieliser)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/lazy-load-4/#post-4575924)
 * You could try adding that to each modal inside a `<script>` tag. Best place would
   be to add them all to your themes .js file if it has one or create one if not.
 *  [schmutly](https://wordpress.org/support/users/schmutly/)
 * (@schmutly)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/lazy-load-4/#post-4576152)
 * On the issue of loading…my sites been excruciatingly slow and i couldnt work 
   out why. Then i turned off the last few plugins till i found it was this one.
   According to [http://gtmetrix.com/](http://gtmetrix.com/) its taking 18 seconds
   to load?
    WHY? turn it off and site loads in few secs. Only have 3 modals that
   load on a different page, and SET for that page…not SITE wide..so dont know why
   its affecting everything. Any ideas because there is no other plugin as good 
   as this. Thank you, robbie
 * UPDATE:
    I had a CLONE of one of my modals still set to SITEWIDE and i think 
   i know whats wrong…the POPUP has many images in it to explain to customers how
   to add products and things like that.
 * Can i please ask..is it possible to only LOAD this modal when its clicked? I’m
   not totally sure its this but I’d suspect so.
 *  [schmutly](https://wordpress.org/support/users/schmutly/)
 * (@schmutly)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/lazy-load-4/#post-4576157)
 * Daniel, that above code..where does it go?
    One of my modal windows is an image
   heavy instructions popup so i need that content only to load if they click on
   the button..The above code should do it? And placed where? At the moment it takes
   10 secs to load the page because of the content and images in the modal window,
   and iss there a way to make it cached so its not needed to load each time they
   visit the page? Thanks muchly, Rob
 *  Plugin Author [Daniel Iser](https://wordpress.org/support/users/danieliser/)
 * (@danieliser)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/lazy-load-4/#post-4576159)
 * Hey Schmulty, You may wanna look at jquery lazy loading images in general. It
   will prevent images from loading if they arnt on screen.
 * A quick google search turned up this.
 * [http://wordpress.org/plugins/bj-lazy-load/](http://wordpress.org/plugins/bj-lazy-load/)
 *  [schmutly](https://wordpress.org/support/users/schmutly/)
 * (@schmutly)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/lazy-load-4/#post-4576160)
 * Ok…ill give that a try, thanks.

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Lazy Load’ is closed to new replies.

 * ![](https://ps.w.org/easy-modal/assets/icon-256x256.png?rev=982657)
 * [Easy Modal](https://wordpress.org/plugins/easy-modal/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/easy-modal/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/easy-modal/)
 * [Active Topics](https://wordpress.org/support/plugin/easy-modal/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/easy-modal/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/easy-modal/reviews/)

 * 11 replies
 * 3 participants
 * Last reply from: [schmutly](https://wordpress.org/support/users/schmutly/)
 * Last activity: [12 years, 3 months ago](https://wordpress.org/support/topic/lazy-load-4/#post-4576160)
 * Status: resolved