I need to create an effect in my slideshow that for each image, the background of div
changes color according to the predominant color of it. I searched the internet for a plugin that does this, and I found Adaptive.Background.js
.
In general it works perfectly, the only problem is that the background color will not update according to the pass of the slides, it changes in the first act and does not change anymore. For the slider, I'm using the bxslider
plugin.
::::: Slider HTML
<div class="banner" id="tween-banner">
<div class="wrapp">
<ul class="bxslider">
<li><img src="image1.jpg" alt="Nome 1" /></li>
<li><img src="image2.jpg" alt="Nome 2" /></li>
</ul>
</div>
</div>
:::: jQuery
SC('.bxslider').bxSlider({
auto:true,
easing:'easeInOutCubic',
useCSS:false,
speed: 1000
})
Does anyone have any suggestions?
One alternative I thought of is inserting the color manually for each image. Example:
<img src="imagem1.jpg" setcolor="#666333" />
<img src="imagem2.jpg" setcolor="#FF0033" />
In this, I would execute a jQuery
that takes the setcolor
value and applies as a background to div
. But I'm not really aware of how I can create this variable within <img>
.