PDA

View Full Version : Can I add a preloader to Background Image Carousel v1.1?



CookieMonster
03-03-2015, 09:06 PM
1) Script Title: Background Image Carousel v1.1

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex14/bgcarousel.htm

3) Can I add an image pre-loader to Background Image Carousel v1.1? If so, where do I put it in the script and what would it be? Would I just put "preload_images: 1;" somewhere to preload the images? If so, where should I put that?

Thanks! :-)

Beverleyh
03-03-2015, 10:51 PM
You can preload images very easily in modern web browsers (IE9+) by placing multiple background images on a pseudo element;
body:after {
display: none;
content: url(path/to/image1.jpg) url(path/to/image2.jpg) url(path/to/image3.jpg);
}No extra markup or javascript required - just CSS.

CookieMonster
03-04-2015, 12:38 AM
Thanks for that info. Where do I put the code:

body:after {
display: none;
content: url(path/to/image1.jpg) url(path/to/image2.jpg) url(path/to/image3.jpg);
}

I just tried inserting that exact thing, (though changing the paths to my images), in both the <head> and <body> sections and both showed the code on the page instead of doing anything.

I'm sorry, but I really need to know exactly where to put this! Thanks! :-)

Beverleyh
03-04-2015, 05:56 AM
It is CSS so put it in your stylesheet.

If you need further help, please provide a link to your page/website.

CookieMonster
03-04-2015, 07:16 AM
THANK YOU! I do not know why I did not see you state it was a "css script" in the first place. Thanks much! :-)