Trying to make two images animate using a single function. The issue is that one image needs to animate the left attribute while the other needs to animate the right. Here's what I have so far:
$(document).ready(function(){
var cat = $('.cat'),
man = $('.man-sitting');
moveImages(cat, "left");
moveImages(man, "right");
});
function moveImages($image, $direction){
$image.delay(500)
.css({
visibility: "visible",
display: "none"
}).animate({
opacity: "show",
$direction: "0px"
}, 1750);
}
The delay and fading are working fine, but the direction is not behaving as expected. Thanks in advance!