bunkat / wordfind

A small javascript library for generating and solving word find (also known as word search) puzzles.
MIT License
194 stars 110 forks source link

Don't work mobile browser #8

Open zismailov opened 7 years ago

zismailov commented 7 years ago

It does not support cross-browser compatibility

tmac187 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 3 years ago

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