10-17-2017 10:35
10-17-2017 10:35
Hello, was wondering if anyone has been playing with the .onclick event for onscreen items. I can't figure out what I'm doing wrong, but basically I have a grid of icons and am trying to trap each icons tap using the onclick event in JS:
tl.onclick = function(e) { console.log("click tl"); tl.href = setTheTile("TL"); }
I have also set the pointer-events="visible" in the index.gui file for each svg element.
What's odd is that this code works fine if the images are towards the bottom of the screen. They seem hit or miss when in the middle and I cannot get anything to register towards the top. I don't think it's the touchscreen since all other menus (slide right) seem to work fine with icons towards the top.
Any ideas of what I might be missing?
Answered! Go to the Best Answer.
10-18-2017 16:22
10-18-2017 16:22
You'll kick yourself.
Look where these 2 <text> elements are drawn 🙂
https://github.com/MicroByter/FitBitDev/blob/master/TicTacToe/resources/styles.css#L13
https://github.com/MicroByter/FitBitDev/blob/master/TicTacToe/resources/styles.css#L23
10-17-2017 11:38
10-17-2017 11:38
Could you put a sample project on Github? It could be device related, but it's best to be sure.
10-17-2017 11:39
10-17-2017 11:39
please simply try these instead
.onmouseup =
.onmousedown =
10-17-2017 18:38
10-17-2017 18:38
10-18-2017 16:22
10-18-2017 16:22
You'll kick yourself.
Look where these 2 <text> elements are drawn 🙂
https://github.com/MicroByter/FitBitDev/blob/master/TicTacToe/resources/styles.css#L13
https://github.com/MicroByter/FitBitDev/blob/master/TicTacToe/resources/styles.css#L23
10-18-2017 17:24
10-18-2017 17:24
Seriously... Just seriously... I am going to hang my head in shame...
Thanks for the 2nd pair of eyes, didn't even think of looking at the CSS.