Navigation
HomeSearch
Submit A Resource
Contact Us
About Functionn
Subscription Options
Subscribe By Email (265+)
Lists
Archives
Nov 29, 2012
gator.js - A JavaScript Library For Simple Event Delegation
Gator is a small (~0.78 kb minified + gzipped), simple, standalone, event delegation library. If you are familiar with jQuery then it may look familiar to you. Out of the box gator works in Chrome, Safari 5+, Firefox 3.6+, and Internet Explorer 9+. The legacy.js plugin adds support for Safari < 5, and Firefox < 3.6 and Internet Explorer 6, 7, and 8.
Why Use Event Delegation?
There are already a number of articles about event delegation and the advantages over traditional event handling. Here are just a few:
improved performance/memory usage - If you have a table with hundreds of cells, and you want to do something when the user clicks on a cell, without delegation you would have to bind the event to each cell. With delegation you could bind a single click handler to the table element.
No need to re-attach events - If you use AJAX to dynamically insert/update content on the current page then you don't have to worry about removing/adding the events every time the content changes. You can bind the events once to a higher level element.
Fewer functions to manage - Without delegation you would have to manage a lot of callback functions. If you remove a bunch of elements you would have to make sure to remove all the events associated with them.
Requirements: None
Demo: http://craig.is/riding/gators
License: Apache License v2.0
Trending Posts On Functionn This Week
Other Interesting Resources:
Trending Posts
Popular Posts
- 20 Fresh, High-Quality Free WordPress Themes 2012
- 50 Fresh, High-Quality Free WordPress Themes 2012 - Edition #2
- The Most Comprehensive Index Of Free Icon Fonts/Iconic Web Fonts
- Timeline - A JavaScript Library For Beautifully Crafted Timelines That Are Easy, And Intuitive To Use
- BLUR.JS - A JQUERY PLUGIN PRODUCING PSUEDO-TRANSPARENT BLURRED ELEMENTS
- Selene - A Stunning & Sleek jQuery UI Theme
- jQuery UI Bootstrap Theme - Bootstrap v2.X's Theme For jQuery UI
Recent Posts
Popular Categories
- JavaScript (535)
- JQuery (275)
- Libraries (132)
- CSS (115)
- frameworks (113)
- Tools (112)
- html (86)
- Github (79)
- html5 (71)
- Node.js (58)
- mobile (52)
- Responsive (49)
- CSS3 (47)
- page effects (45)
- Web Design (41)
- Bootstrap (35)
- twitter (31)
- image effets (22)
- MVC (18)
- generators (18)
- CoffeeScript (16)
- graphics (10)
Popular Components
- icons (42)
- Graphs (22)
- popups (19)
- notifications (17)
- web fonts (17)
- visualizations (14)
- sliders (11)
- polyfills (10)
- localstorage (8)
- social media buttons (8)
Popular Licenses
- MIT License (493)
- free (144)
- GPL (64)
- Apache License v2.0 (48)
- CC Attribution 3.0 License (46)
- GPLv2 (20)
- GPLv3 (11)
- Custom License (7)
0 comments:
Post a Comment