JavaScript
  Home arrow JavaScript arrow Mouseover Events and Event Delegation in JavaScript
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
Google.com  
JAVASCRIPT

Mouseover Events and Event Delegation in JavaScript
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 4
    2009-04-22


    Table of Contents:
  • Mouseover Events and Event Delegation in JavaScript
  • Review: JavaScript event delegation with click handlers
  • Enhancing event delegation with mouseover events
  • Putting it all together: a final (X)HTML file

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Mouseover Events and Event Delegation in JavaScript
    ( Page 1 of 4 )

    Expressed in simple terms, JavaScript event delegation is a smart approach that permits you to reduce the number of event handlers assigned to the elements of a web page by using the bubbling phase of a specific event. With this easy-to-learn technique you can significantly improve the performance of JavaScript applications. This is the second article in a four-part series.

    Therefore, if you’re interested in learning how to implement event delegation within your own JavaScript programs, then in this group of articles you’ll find an approachable guide that will help you to master the key concepts that drive this powerful approach, with numerous code samples. 

    Now that you've been introduced to the subject of this series of tutorials, it’s time to quickly review the topics that I discussed in the last part. In that particular article I explained how to implement event delegation in JavaScript without being an expert in client-side scripting. 

    Speaking more specifically, I demonstrated an easy way to apply a basic highlighting effect on all of the cells of an HTML table. The technique involved assigning only one click handler to the table in question, instead of coding multiple ones. Essentially, this sample application took advantage of the bubbling phase of all the clicks that occurred within the HTML table to highlight a particular cell. It was that simple, really. 

    Nonetheless, JavaScript event delegation is also well supported by other event handlers, including the popular “mouseovers.” Therefore, in this second article of the series I’ll be explaining how to implement this approach by partially recreating the example developed previously. 

    Are you ready to learn how to extend the use of event delegation in JavaScript? Then let’s get started!  



     
     
    >>> More JavaScript Articles          >>> More By Alejandro Gervasio
     

       

    JAVASCRIPT ARTICLES

    - Introduction to JavaScript
    - Adding Elements to a Tree with TreeView jQue...
    - Using the Persist Argument in a TreeView jQu...
    - Using Unique and Toggle in a TreeView jQuery...
    - Using Event Delegation for Mouseover Events ...
    - Using the Animate Option in a Treeview jQuer...
    - Using HTML Lists with Event Delegation in Ja...
    - Opened and Closed Branches on a TreeView jQu...
    - Mouseover Events and Event Delegation in Jav...
    - Creating a TreeView JQuery Hierarchical Navi...
    - Event Delegation in JavaScript
    - A Look at the New YUI Carousel Control
    - Working with Draggable Elements and Transpar...
    - Displaying Pinned Handles with Resizable Con...
    - Building Resizable Containers with the Ext J...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek