Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
108 views
in Technique[技术] by (71.8m points)

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?

Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...