CUSTOMIZE BROWSER EVENTS WITH JQUERY

One of jQuery’s strengths is its capability to modify browser activity based on what event you are interested in, rather than how to monitor the event and override it, as in the traditional JavaScript process.

There are three components required when customizing a browser event in jQuery: What is the object, what will the user do to that object, and what process occurs when the user does it.

The first component is easy; that is the standard $(selector) you have used earlier. The second component is the event method itself. Here are some of the most common browser events you can customize:

  • click(), dblclick() — When the user clicks or double-clicks an object.
  • hover() — When the user hovers over an object. ...

Get HTML5: Your visual blueprint™ for designing rich web pages and applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.