Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

event.originalEvent jQuery

I am currently immersed in the jQuery learning center. I'm going from start to end.

I just read this paragraph:

It's also important to note that the event object contains a property called originalEvent, which is the event object that the browser itself created. jQuery wraps this native event object with some useful methods and properties, but in some instances, you'll need to access the original event via event.originalEvent for instance. This is especially useful for touch events on mobile devices and tablets.

The last sentence, 'This is especially useful for touch events on mobile devices and tablets.', really sparked my interest. but this is as much as the learning center goes into originalEvent thus far.

Does anyone know of good resources for a more intensive study/practice for event.originalEvent specifically in relation to touch events/mobile devices?

like image 909
BryanK Avatar asked May 21 '13 16:05

BryanK


People also ask

What is event originalEvent?

event. originalEvent is usually just the native event (also described here). However, if the browser is compatible, and the event was a touch event then that API will be exposed through event. originalEvent . The short answer is that event.

Does jQuery have an event object?

As of jQuery 1.6, you can also pass an object to jQuery. Event() and its properties will be set on the newly created Event object.

What are event handlers in jQuery?

A jQuery Event is the result of an action that can be detected by jQuery (JavaScript). When these events are triggered, you can then use a custom function to do pretty much whatever you want with the event. These custom functions are called Event Handlers.

What is event object in jQuery?

jQueryWeb DevelopmentFront End Technology. The callback function takes a single parameter; when the handler is called the JavaScript event object will be passed through it.


1 Answers

event.originalEvent is usually just the native event (also described here).

However, if the browser is compatible, and the event was a touch event then that API will be exposed through event.originalEvent.

The short answer is that event.originalEvent is not always the same, it depends on which event type triggered the handler, and on the environment of the browser.

like image 174
Travis J Avatar answered Nov 11 '22 12:11

Travis J