Cycle plugin - undesired style
Hi There,
I testing cycle plugin but I found that it add some 'unwanted' style to the 'rotating' <div>.
Below an example of what devTools in chrome show if cycle is loaded.
Without loading cycle the layout is fine (plain default).
background-color: rgb(147, 161, 161); position: absolute; top: 0px; left: 0px; display: none; z-index: 9; opacity: 0; width: 194px; height: 93px;
I am using the plugin from:
http://malsup.github.io/jquery.cycle.all.js
This is the element in my source file:
for(var i=0; i < products.length; i++){
productsListItems += `
<div class="product">
<img src="/images/food/${products[i].image}" alt="image">
<h3>${products[i].mealName}</h2>
<h4>${products[i].dietaryRestrictions}</h3>
<h3>Description</h3>
<p>${products[i].description}</p>
<h3>Ingridients</h3>
<p>${products[i].ingridients}</p>
</div>
`;
}
and this is how I call the plugin:
$('#productsCarousel').cycle({
fx: 'fade',
pause: 1,
next: '#next_btn',
prev: '#prev_btn',
speed: 500,
timeout: 10000
});
Beyond the obvious background color (black) I have a funny behavior with element positioning in the wrapper div, img sometimes floats correctly, sometimes not. It seems that the plugin messes up with div's styling.
Any advice?
Cheers.