$('#scrollbar1').css('width','1000px');
$('#scrollbar1 img').css('width','980px');
setInterval(function(){
var ff = $('#scrollbar1 img:first');
var ll = $('#scrollbar1 img:last');
var nn = ll.prev();
nn.show();
ll.fadeOut(1000,function(){
ff.before(ll);
});
},2000);
Above is my jquery code for a simple jquery slideshow
And the associated html is something like:
<div id="scrollbar1">
<img src="images/intro/intro3_1.jpg">
<img src="images/intro/intro3_2.jpg">
<img src="images/intro/intro3_3.jpg">
<img src="images/intro/intro3_4.jpg">
<img src="images/intro/intro3_5.jpg">
<img src="images/intro/intro3_6.jpg">
<img src="images/intro/intro3_7.jpg">
</div>
This works perfectly in desktop browsers, but on IPAD the effect is really choppy. Any idea how can I make the animation as smooth as in the desktop versions?
I would use CSS transitions and
addClass()rather than fadeOut. In IE you’ll just get a straight hide/show effect, but in all other modern browsers CSS opacity fades will be smoother and faster.Check out this JSfiddle to see my approach in action: http://jsfiddle.net/GFmM8/47/