Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't work mobile browser #8

Open
zismailov opened this issue Feb 14, 2017 · 5 comments
Open

Don't work mobile browser #8

zismailov opened this issue Feb 14, 2017 · 5 comments

Comments

@zismailov
Copy link

It does not support cross-browser compatibility

@tmac187
Copy link

tmac187 commented Jan 15, 2018

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.

@ali-mohtashim
Copy link

ali-mohtashim commented Jan 29, 2018

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.

@tmac187
Copy link

tmac187 commented Jan 29, 2018

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

@tmac187
Copy link

tmac187 commented Jan 29, 2018

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

@dikyoktafian
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants