Page 2 of 2

Re: Need Help

PostPosted: Fri, 16Jan22 12:00
by kexter
tlaero wrote:My current theory is that when it works it switches to the anim1rch before you let go of the click. When it doesn't work, you let go of the mouse before it switches, so when it gets to anim1rch, the mouse is already up. I've got a fast computer, so maybe I'm not seeing that.
That is pretty much the issue, mouseup/pointerup happens during the transition between the pages. It's not the fast computer that counts but the driver for the mouse/pointer device, the heavy handedness of the user, the double-click interval settings, ssd/hdd activity, and the browser's internal state (is it in a GC cycle just as the transition happens or is another tab hogging resources that slows down the page-load just enough that the up-event happens before the page is loaded?)
Due to all of the above, I would use only a single page to achieve the same effect.

And on a slightly related note, here's a single function that could replace SetUp, SetUp2, and in the future SetUp3, SetUp4, etc:
Code: Select all
function onUp(id, func, args) {
  var that = this,
    funcArgs = [].slice.call(arguments, 2);
  if (typeof id !== "undefined" && typeof func === "function") {
    document.getElementById(id).addEventListener(
      typeof PointerEvent !== "undefined" ? "pointerup" : "mouseup",
      function () { func.apply(that, funcArgs); });
  }
}

The order of the parameters is different and "id" is not optional but you can call it with any number of arguments. For example:
Code: Select all
function onUp("image", functionRequiringNoArguments);
function onUp("image", functionRequiringOneArgument, arg1);
function onUp("image", functionRequiringTwoArgument, arg1, arg2);
function onUp("image", functionRequiringFiveArguments, arg1, arg2, arg3, arg4, arg5);

Re: Need Help

PostPosted: Fri, 16Jan22 12:47
by Joka
Win 10 - 64 bits - Chrome 47.0.2526.111 m
Worked fine

Win 10 - 64 bits - Microsoft Edge
Worked fine too

Re: Need Help

PostPosted: Fri, 16Jan22 15:54
by tlaero
Thanks Kexter. I explicitly chose to do it that way because I didn't want to type the id.

Tlaero

Re: Need Help

PostPosted: Fri, 16Jan22 17:48
by MrT1melord
W7 x64 Firefox 43.0.4

1) Number goes to 4 instantly and then counts down to 0
2) Works as intended
3) Works like 1 but whatever number I release at it just goes straight to 4 and then counts down normally to 0(EG if I release it at 2 it jumps to 4 and then 3 2 1 0)

Re: Need Help

PostPosted: Fri, 16Jan22 18:34
by karrek
Win 10 x64 Firefox

1 - Most of the time it works as intended, but sometimes it jumps straight to 4 and then counts down, and other times it behaves like 2 (with it continuing until I click again)
2 - Works as intended
3 - Works as intended

Re: Need Help

PostPosted: Fri, 16Jan22 19:00
by Mortze
Do love when karrek posts something [img]images/icones/icon14.gif[/img]

Re: Need Help

PostPosted: Fri, 16Jan22 19:53
by syramore
OS Windows 10 Enterprise Inside Preview - Evaluation Copy Build 11102.rs1_release.160113-1800

Microsoft Edge - 28.11102.1000.0
1 - Goes directly to 4 then count downs to 0
If you click a second time -- it counts to 4 turns black and keeps running even if you are not holding the button. You have to click again to stop it
2 - Works as expected
3 - Works as expected

Microsoft Internet Explorer 11.1000.11102.0
1 - Goes directly to 4 then counts down to zero
This performs the same way no matter how many times you click
2 - Works as expected
3 - Works as expected

Chrome 47.0.2526.106 m (64-bit)

1 - Goes directly to 4 then counts down to zero
This performs the same way no matter how many times you click
2 - Works as expected
3 - Works as expected

Firefox 43.0.4
1 - Goes directly to 4 then counts down to zero
This performs the same way no matter how many times you click
2 - Works as expected
3 - Works as expected

Re: Need Help

PostPosted: Sat, 16Jan23 02:27
by tlaero
Thank you, everyone. I've got all the data I need now.

Here's what you've done for me.
1) You showed me that it's not an issue of incompatibility between browsers. (I don't need special code for Firefox, etc.)
2) You gave me enough data that I was able to understand what's happening.
3) And, with the understanding of what's happening, I know that, even when this happens, clicking in the middle window will fix it.
4) Finally, I understand that if the user does it correctly (holds the mouse button until the color inverts) it should work for everyone.

There's no good way to harden the current mechanism against the issue. And the right way to fix it is enough of an infrastructure change that I don't want to do it for this release. But, since it can work on all browsers and users can do it right, I'll be able to ship it this way. Non-ideal, but not terrible either. Disaster averted. That reduces my stress a ton.

Thank you very much, everyone. I really appreciate all of your help.

Tlaero