问题
Cycle overwrites the position for the images in the div with top:0 left:0 is there a way to stop that so I can use inline positioning?
回答1:
No.. You can cycle some divs and inside those divs you can use whatever inline styles you need on the images. Jquery Cycle uses its own positioning of the cycled elements to make the slideshow. Here is an example:
<div id="slideshow">
<div><img src="pic.png" style="margin-left:10px" /></div>
<div><img src="pic2.png" style="margin-left:10px" /></div>
<div><img src="pic3.png" style="margin-left:10px" /></div>
<div><img src="pic4.png" style="margin-left:10px" /></div>
<div><img src="pic5.png" style="margin-left:10px" /></div>
</div>
$('#slideshow').cycle();
回答2:
You can write some custom css rules for each inline style, and append !important
to each value, which will override the inline rules.
来源:https://stackoverflow.com/questions/10338413/can-you-stop-jquery-cycle-from-overwriting-inline-absolute-position