Javascript Image Slider / Posts /

Maintaining a background color in slider for transparent images?

I am using a slider on my site based on demo 7. My images are all .svgz files (despite all caveats), and I would like them to have a different background color than the rest of the site. Rather than going through every file in Illustrator, making a new (background) layer, and creating a rectangle with the appropriate fill color (in this case, #fff), I was wondering if there was a way to modify the script to the slider to add this background color automatically. (This would be especially helpful as I will gradually be adding new images to the site, so it will save me some time in the future as well.) I had no luck in CSS, even when working with the containing #sliderFrame.

I'm assuming that the script replaces the background attribute in #slider with whatever images are populating the slider at the time. Is there a way to make it so that, instead of writing the background as "background:url(/images/file.svgz) [...]", it is written as "background:#fff url(/images/file.svgz) [...]"? If this is what indeed is happening?

Thank you!
Mitchell  6 years ago   viewed: 6106    

2 Answers

It might not be possible as the slider will create new DIV elements with the images as the DIV's backgrounds.
The slider is actually scrolling those DIVs.
milo   6 years ago
Thank you for the quick response!

So it is not possible, then, for me to make it so that these DIV elements display as a background the images over a solid background color? (Similar to the default "loading.png" background in js-image-slider.css for Demo 7: "background:#fff url(/images/loading.png) no-repeat 50% 50%;")

If not, it's only a minor inconvenience. Thanks again for the reply.
Mitchell   6 years ago


Your name*
(Optional. Used to modify this post afterwords)
+ =  

Ask your Own Question

  • If your question is related to the topic of this post, you can post your question to this page by clicking the "Post a reply" button at left;

  • When you want to start a new page for your question: