I'm using TouchSwipe plugin to make some animations. The main problem is on this event:
$(".swipe-area").swipe({
swipeStatus: function (event, phase, direction, distance) {
if (phase == "move") {
$('.book').css({
'-webkit-transform': 'rotateY(' + distance + 'deg)',
'transform': 'rotateY(' + distance + 'deg)'
});
}
},
triggerOnTouchEnd: false,
threshold: 90
});
The markup:
<div class="book-container">
<div class="book-flipper">
<div class="book">
<img src="assets/img/book.png" alt="" width="260" height="560">
</div>
</div>
</div>
And the CSS:
.book-container {
-webkit-perspective: 1000;
perspective: 1000;
position: absolute;
left: 766px;
top: 278px;
z-index: 99;
}
.book-container, .book {
width: 260px;
height: 560px;
}
.book-flipper {
-webkit-transition: 0.6s;
transition: 0.6s;
-webkit-transform-style: preserve-3d;
transform-style: preserve-3d;
position: relative;
}
.book {
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
-webkit-transform: rotateY(0deg) ;
transform: rotateY(0deg) ;
}
On desktop, it's work fine. But on mobile (iPad Safari), the image don't animate while touch and drag.