Re: Need Help
Posted: Fri, 16Jan22 12:00
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?)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.
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);