bunkat/wordfind

Don't work mobile browser

Opened this issue · 5 comments

It does not support cross-browser compatibility

Agreed. I noticed that you can't drag your finger over a word on the iphone. It doesnt highlight the word like it should rendering this game useless on mobile.

Hello Guys,

wordfindgame.js
var touchMove = function (e) {
var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
var xPos = touch.clientX;
var yPos = touch.clientY;

        //var xPos = e.originalEvent.touches[0].pageX;
        //var yPos = e.originalEvent.touches[0].pageY;
        var targetElement = document.elementFromPoint(xPos, yPos);
        select(targetElement);

    };

## Copy above code and replace with below code
var touchMove = function(e) {
var xPos = e.originalEvent.touches[0].pageX;
var yPos = e.originalEvent.touches[0].pageY;
var targetElement = document.elementFromPoint(xPos, yPos);
select(targetElement)
};
This code is working on all devices
Thanks.

I am using the below code already. That's actually what comes with the latest download. And it doesnt work on iphone at least. I havent tested on android

Ahh, you meant to say "copy above code and replace THE below code"? Either way, the above code seems to be working for me now. Thanks

Hello Guys,

wordfindgame.js
var touchMove = function (e) {
var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
var xPos = touch.clientX;
var yPos = touch.clientY;

        //var xPos = e.originalEvent.touches[0].pageX;
        //var yPos = e.originalEvent.touches[0].pageY;
        var targetElement = document.elementFromPoint(xPos, yPos);
        select(targetElement);

    };

## Copy above code and replace with below code
var touchMove = function(e) {
var xPos = e.originalEvent.touches[0].pageX;
var yPos = e.originalEvent.touches[0].pageY;
var targetElement = document.elementFromPoint(xPos, yPos);
select(targetElement)
};
This code is working on all devices
Thanks.

its work