});
$(document).on('mousewheel', function (e) {
+ if(this.element===undefined){
+ return true;
+ }
var s = $this.scale;
s += 0.25 * e.deltaY;
$this.scale = $this.normalizeScale(s);
},
setMovePos: function (x, y) {
+ if(this.element===undefined){
+ return;
+ }
x = Math.max(this.dragMinX, Math.min(this.dragMaxX, x));
y = Math.max(this.dragMinY, Math.min(this.dragMaxY, y));
},
resize: function () {
+ if(this.element===undefined){
+ return;
+ }
this.element.closest('.zoomhdRefScale').css({transform: 'scale(' + this.refScale + ')'});
this.element.css({transform: 'scale(' + this.scale + ')'});
this.currentImageWidth = this.initialImageWidth * this.scale;