I’m basically trying to build the equivalent of the firebug inspector in the browser. I’m currently using the <body> as the container in this example: In the inspect method, I reposition and resize a semi-transparent fixed positioned element over the element returned from the event target. But this causes the mouseover event to subsequently inspect the overlay element itself. I
Tag: event-handling
Which events are the most intensive?
Which events are the most resource intensive to have attached? Is a mouseover “worst” than a click? Are there any events that are known to be really harsh on the browser? I have my sights on IE7 mainly, as we are seeing performance issues there. We use event delegation where we can. Or, how can I profile events which are
Why is event.ctrlKey returning undef?
I am calling a JavaScript function when an option is selected in a select element like so: The function does something like this: According to the alert, e.ctrlKey is undefined – I thought this was supposed to return either true or false? What am I missing here? Answer As per the standard, the attribute ctrlKey is only available on MouseEvents
Why is JavaScript sending an element to my event handler, when that element has no event?
This html: This JavaScript takes the span containing the image and text, then makes it clickable: If I click on the “Link text,” then the obj in myEvent() is the span. If I click on the image, then the obj is the image element! The image itself has no event. So why isn’t it always the span that gets passed
JavaScript add events cross-browser function implementation: use attachEvent/addEventListener vs inline events
In order to add events we could use this simple first solution: or this second solution (that adds inline events): These are both cross-browsers and can be used in this way: Since I have the feeling attachEvent/addEventListener are used more around in events handling implementations, I’m wondering: Are there any disadvantages/drawbacks against using the second solution that I might better
Why do I get wrong, doubled input value on keyup when typing fast?
When one is typing slowly “a” & “b” the above code will result in “a”, “b” in the console log. But the problem is when somebody does it quickly. The result then is “ab”, “ab”. It’s easier to repeat this situation with letters which are near on a keyboard e.g. “e” & “r”. How to avoid it? Events keydown and