For some reason, click events on my live server take significantly longer to fire than on my local development machine. For example, here's some basic code I used as a test:
jQuery(document).ready(function(){
jQuery('a[rel^="foxyLightbox"]').on("click", function(e) {
console.log("HA!");
return false;
});
});
When I run that locally and click on links, the text prints out to the console pretty much instantaneously. If I click it a bunch of times in a row, there's no lag whatsoever.
When I run it on my live server, there's almost exactly a one second delay before the event fires. If I click it a bunch of times in a row, then there is lag and it prints out about once a second.
Here's a live example page: https://www.foxytronics.com/products/68-springrc-sm-s4303r-continuous-rotation-servo
The link that triggers the event is the large product image in the upper right.
At first I thought the issue was my javascript code, but then I commented it out and used the test code above (which is extremely short), so that can't be it. What could be delaying the click event from firing?
The HTMLElement. click() method simulates a mouse click on an element. When click() is used with supported elements (such as an <input> ), it fires the element's click event. This event then bubbles up to elements higher in the document tree (or event chain) and fires their click events.
No, but your function can set a timer event for whatever delay you want to handle it later.
Open Google Chrome and press F12 to open Dev Tools. Go to Event Listener Breakpoints, on the right: Click on the events and interact with the target element. If the event will fire, then you will get a breakpoint in the debugger.
I used chrome dev tools and I see that you have strange long mouseDown event handler:
Some work is performed in JS script from static.getclicky.com
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With