preload bg image

jani's Avatar


22 Dec, 2012 05:34 PM

I need to use bg images in DIVs. Is there a way to preload them?
If not, maybe just putting a hidden img tag on the slide with same image might work?


  1. Support Staff 1 Posted by Dmytro Semenov on 23 Dec, 2012 08:43 AM

    Dmytro Semenov's Avatar


    Not sure why you need to preload it for each slide separately. As an option, you may write your function that will preload image using jQuery and append it to slide when required.

    If you explain better, I might help more.


  2. 2 Posted by jani on 23 Dec, 2012 09:17 AM

    jani's Avatar

    I'm using different, large background-images inside some slides like this:

    Regular images with rsImg class load and get preloaded fine, but bg images tend to load last. It doesn't work too smoothly while royal slider finishes loading and after that bg images might still be loading.

    This is the project:
    Right now script waits for everything to load:
    $(window).load() It takes long when using slow connection.
    this is why I would like to preload also div bg images and move back to:
    jQuery(document).ready(function($) {

  3. Support Staff 3 Posted by Dmytro Semenov on 24 Dec, 2012 03:03 PM

    Dmytro Semenov's Avatar

    Sorry for late reply. You may try to use jquery.imagesloaded plugin, it will fire when specified images are loaded.


  4. 4 Posted by jani on 01 Jan, 2013 01:03 PM

    jani's Avatar

    lazy loading and latest build did it for me.

  5. jani closed this discussion on 01 Jan, 2013 01:03 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac