init: function () {
var $this = this;
- $("#main").on('touchend',function(){
- console.log('touchend from jquery');
- })
-
// Pinch to zoom
- interact(document.getElementById("main")).gesturable({
+ interact(document.getElementById("z")).gesturable({
onstart: function (event) {
if ($this.fluidbook.zoom.zoom == 1) {
$this.setZoomOriginFromEvent(event);
onmove: function (event) {
var ds = event.ds;
//if ($this.fluidbook.support.iOS) {
- if (ds > 0) {
- ds *= 0.25;
- } else {
- ds *= 0.75;
- }
+ if (ds > 0) {
+ ds *= 0.25;
+ } else {
+ ds *= 0.75;
+ }
//}
var s = $this.fluidbook.zoom.zoom * (1 + ds);
$this.pinchZoom(s);
return false;
},
onend: function (event) {
- console.log('pinch end');
return false;
},
}).draggable({
},
onend: function (event) {
$this.resetSlide();
- console.log('drag end');
}
});
// Double tap
interact(document).on('doubletap', function (event) {
-
if ($this.fluidbook.zoom.zoom > 1) {
$this.fluidbook.zoom.setTransition(true);
$this.fluidbook.zoom.resetZoom();
if (e.dx == 0 && e.dy == 0) {
return;
}
-
-
var currentX = (parseFloat(this.fluidbook.zoom.origin[0]) / 100) * this.fluidbook.resize.ww * this.fluidbook.zoom.zoom;
var currentY = (parseFloat(this.fluidbook.zoom.origin[1]) / 100) * this.fluidbook.resize.hh * this.fluidbook.zoom.zoom;
var m = 2;
- //if (this.fluidbook.support.android) {
- // m = 10;
- //}
var x = currentX - e.dx * m;
var y = currentY - e.dy * m;