Whenever I try to animate my container (described below), I'm often experiencing some lag (like choppy movement) of the container. I've made some re-search and tried some stuff, but haven't found a solution. The only thing I did found out tho, was that if I remove all images but one, everything works smooth.
So by eliminating all the images, and just having one there, solves the issue. But I need all the images.. the functionality is a slideshow actually (regular fade transition of images).
Please take a look at my setup, and notice me if I'm doing any bad things here (currently only for WebKit):
<div id="container">
<div id="inner">
<div class="image"></div>
<div class="image"></div>
<div class="image"></div>
[...]
</div>
</div>
With the CSS:
#container {
width:100%;
height:100%
position:absolute;
-webkit-transform: translate3d(0,0,0);
-webkit-transition: -webkit-transform 800ms linear;
-webkit-backface-visibility: hidden;
-webkit-transform-style: preserve-3d; /* *should* improve performance? */
}
#inner {
position:relative;
width:100%;
height:100%;
}
.image {
position:absolute;
left:0;
top:0;
background-image:[something];
width:100%;
height:100%;
background-size:cover;
}
Then I just do a couple of these in my code to make the container move around
$('#container').css('-webkit-transform', 'translate3d(0,500px,0)');
Thanks in advance!
EDIT: Here's a fiddle btw (remember that the result-window is very small here, which gives me nice smoothness. But in full-screen, its a bit choppy)
EDIT2: Fixed the broken fiddle!