Hi guys, Just doing my first site with GSAP and have the following URL http://chinaready.mywebone.com/marketing On the right hand side mid-way down the page there is a blue box next to "a welcome sign for Chinese travelers" which, when you hover or click, needs to flip and on hover exit / click again the box needs to rotate back to its resting side. The hover works for me on desktop, and on touch devices the box flips. But I cannot get it to flip back on touch again, or when you click away from the box. The JS code I have used is below.
Could someone please help me with (on touch again) flipping the box back over.
jQuery(document).ready(function(){
var travelerscol = jQuery('.welcome-signs .col-sidebar');
var travelersfront = jQuery('.welcome-signs .col-sidebar .front');
var travelersback = jQuery('.welcome-signs .col-sidebar .back');
TweenMax.set(travelersback,{rotationY:-180});
TweenMax.set([travelersfront, travelersback],{transformStyle:"preserve-3d", backfaceVisibility:"hidden", perspective: 800});
jQuery.each(travelerscol, function(i,element)
{
travelerstl = new TimelineMax({paused:true});
travelerstl
.to(travelersfront, 0.4, {rotationY:180})
.to(travelersback, 0.4, {rotationY:0},0);
element.animation = travelerstl;
});
jQuery(travelerscol).hover(elOver, elOut);
function elOver()
{
this.animation.play();
}
function elOut()
{
this.animation.reverse();
}
});