I first tried using CSS, but when I was informed that it looks buggy on Safari, I tried with Greensock's Javascript library to see if it fixes it. It still has the same issues, still only on Safari. After a bit of research I saw it discussed on StackOverflow as a Safari bug.
jQuery(function($){
var iconsHoverIn = function() {
TweenMax.to($(this).find('.iconBG'), 0.5, {
rotationY: 180,
opacity: 0
}
);
TweenMax.to($(this).find('.hoverImage'), 0.5, {
rotationY: '-180',
opacity: 1
}
);
}
var iconsHoverOut = function() {
TweenMax.to($(this).find('.iconBG'), 0.5, {
rotationY: 0,
opacity: 1
}
);
TweenMax.to($(this).find('.hoverImage'), 0.5, {
rotationY: 0,
opacity: 0
}
);
}
$('.iconBlock').hover(iconsHoverIn, iconsHoverOut);
});
The bug is: while doing the transition, half of the element seems to transition differently than the other half. It shows a line in the middle, like if the element was made of paper and was bending in half.
Is there any way around it? I presented a few animations to the client, but this animation (rotateY) was the unanimous selection.
Note: I am somewhat new to Javascript and Greensock. You may notice better ways to do what I did. I wouldn't mind suggestions on improving it, but what I am really after is a solution to the bug/glitch.