Skip to content
Advertisement

Tag: dom-events

JavaScript inline events syntax

Is there any reason to use one of the following more than the others: And please do not spend your valuable time to tell me to use jQuery or attachEvent/addEventListener. It’s not really the objective of my question. Answer There’s no difference at all between the first two, in this specific situation the semicolon is optional. The third one will

Capture mouse position on setInterval() in Javascript

I have a function in Javascript that moves one div depending on the mouse position. This function is set on a setInterval() function and executed every second. I need to capture the mouse position like this: Ps: I cannot use the mousemove event because the function must be executed even if the mouse is stopped. Answer The only time that

JavaScript mapping touch events to mouse events

I’m using the YUI slider that operates with mouse move events. I want to make it respond to touchmove events (iPhone and Android). How can I produce a mouse move event when a touchmove event occurs? I’m hoping that just by adding some script at the top that touchmove events will get mapped to the mouse move events and I

Capture javascript event in IE Mobile

I need to detect the id of the element that generated an onchange event. This code work in most modern browsers: But it does not work in IE Mobile. I have tried the following code, and at least the event is fired and the handler function is called, but window.event is not available when event handler is called: Is there

image.onload not firing twice in IE7

It works in IE6, and FireFox; but for some reason not in IE7. Using ASP.NET on the Page_Init I populate a list of chapters that are links to the image in the book as well as a Javascript array which holds the pageIDs. ex. Chapter 1 –> href=”javascript:seePage(4);” Here is the actual code I am using: When I click on

Advertisement