Skip to content

Not working on iPad/iphone safari #1

@firstpixel

Description

@firstpixel

I did a fix to work on iPad/iphone, it still blinking but now at least it drags the mask:

add Event touchmove on both calls:

$(window).on('mousemove touchmove',function(e) {    _this._movement(e); });

and

$(this.element).on('mousemove touchmove', function(e) { e.preventDefault(); if((new Date()).getTime()%20 === 0) {  _this._action(e,'hover');
            }
});

fix the function _movement:

_movement: function(e) {
             if(e.originalEvent.touches && e.originalEvent.touches.length) {
                    e.preventDefault();
                    var e = e.originalEvent.touches[0] ;
                } else if(e.originalEvent.changedTouches && e.originalEvent.changedTouches.length) {
                    e.preventDefault();
                    var e = e.originalEvent.changedTouches[0];
                }
            this.mouseX =   e.clientX;
        this.mouseY =   e.clientY;
        this.renderOverlay();
        },

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions