Javascript Image Slider / Posts /

Maintaining a background color in slider for transparent images?

1
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  5 years ago   viewed: 5929    

2 Answers

0
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   5 years ago
0
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   5 years ago

   

Your name*
Password
(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: