0

I'm building a JavaScript Tizen app for Gear S2 In an earlier stage of development I considered using Angular, but I just ignored the possibility entirely because ng-click events made the screen flicker.

I kept building the app without any issues, my click event worked fine! Until I incorporated jQuery mobile and suddenly my app now flickers when I "tap" the emulator. I tried binding the event in 3 different manners, with the same result:

window.addEventListener("click", callback); // way 1
$(document).bind("click", changeMode); // way 2
$(document).bind("tap", changeMode); // way 3

does anyone have a clue of why this might be happening?

DeadlyBacon
  • 531
  • 4
  • 17

1 Answers1

0

When do you bind the click event? Maybe you add the listener multiple times, so your Callback is also triggered multiple times.
Also why add the click listener to the window/document instead of a proper element?

I would also prefer to use ".on()" and ".off()" instead of bind.

Maybe you can share some of your code so we can "see" the problem?

motu
  • 43
  • 6
  • its added 1 time. Also I have multiple elements in the app that need to respond trigerring the same function when I click – DeadlyBacon May 19 '16 at 14:04
  • Thanks for the tip, my jQuery is a bit rusty. not that I was ever a pro at it but hey – DeadlyBacon May 19 '16 at 14:05
  • I fixed the problem by copying a custom swipe event "library" I found. I had to fix many things about the code because it was a mess that had no beauty to it whatsoever. BUT it worked – DeadlyBacon May 19 '16 at 14:07
  • The very same code runs fine without including jquery mobile And flickers when jquery mobile is added, kind of strange, when I get my hands on my laptop ill share some snippets – DeadlyBacon May 19 '16 at 14:09