We rejig the JS to just add the class rather than the any styles:
setTimeout(function(){
$('.latest-stats').toggleClass('transitioned').each(function () {
// Call back functions here
});
}, 1000);
I use setTimeout() since delay() only works for animations. I use each() to add my callback function, since toggleClass() doesn't have a callback, and this way I don't need to load an extra library.
Then the CSS handles the changes to the styles, keeping all the visual aspects in one location:
.latest-stats {
-webkit-transition: all 0.5s;
-moz-transition: all 0.5s;
transition: all 0.5s;
position:absolute;
opacity:0;
margin-left:40px;
padding: 30px;
background:red;
margin:40px;
}
.latest-stats.transitioned {
opacity:1;
-webkit-transform:translate(55px, 0);
-moz-transform:translate(55px, 0);
transform:translate(55px, 0);
}
Note I'm using translate to shift the element rather than margin-left as the browser doesn't have to change the layout or perform a repaint on the element, which can improve the animation. However, check for browser support and provide fallbacks when necessary/appropriate.
Here's a JSFiddle.