I am doing a simple animation of just 3 objects. When I do this animation on a normal page, it works just fine. When I transfer it over to a Wordpress template, the animations seem to queue up and run one at a time
I've tried This S.O. Solution but it did not work.
The desired behavior is Here. When you hover over an image, the image you hover over (if it's not #1) animates at the same time as the other images that are 'getting out of the way'.
The incorrect behavior is Here. As you can see, when you hover over an image, the slides that are not being hovered over animate first, then the slide you have 'selected' hovers to the correct position.
The problem is the "then". All of these tiles should animate at the same time.
Here is the jQuery:
var speed = 500,
ease = "easeInOutCirc",
inc = 5;
$(document).ready(function(){
$('#hero .featured').hover(function(){
var e = $(this).index();
console.log(e);
$('#hero .featured').each(function(i){
$(this).find('.content-box').animate({"width":"100%"}, speed, ease);
if(i > e){
$(this).stop().animate({"left":100-(($('#hero .featured').length - i)*inc)+"%"}, speed, ease);
console.log("right");
} else if(i <= e){
$(this).stop().animate({"left":i*inc+"%"}, speed, ease);
console.log("left");
}
});
}, function(){
$('#hero .featured').each(function(i){
$(this).find('.content-box').animate({"width":"100%"}, speed, ease);
$(this).stop().animate({"left":i*25+"%"}, speed, ease);
});
});
});
So, why is it, that when I add exactly the same HTML and exactly the same javascript to a wordpress template, does it animate incorrectly? I've even included the same jQuery library in each demo.
Any solutions?