I have a simple page onload effect that slides an absoluted empty div from 100% to 0% using CSS3 transitioning
jQuery:
$(window).on('load', function() {
$("#curtain").css('width', '0');
});
CSS:
#curtain {
position: absolute;
z-index: 10;
width: 100%;
height: 100%;
transition: 1s;
float: left;
}
However, upon testing, the animation is visibly laggy. It would stagger at a low framerate and speed up tons at the end because of it. I tried binding the curtain animation to a button, and it worked perfectly smoothly, leading me to the conclusion that window onload is the issue. Is there any way I can fix this?