JavaScript/Notes/DomEvents

From Noisebridge
< JavaScript(Difference between revisions)
Jump to: navigation, search
(Dom Event Publisher)
 
Line 7: Line 7:
 
   purgeEvents(obj, eventOrList);
 
   purgeEvents(obj, eventOrList);
 
}
 
}
 +
</source>
  
 
=== Cross-browser DomEvent Adapter ===
 
=== Cross-browser DomEvent Adapter ===
Line 16: Line 17:
 
   stopPropagation : stopPropagation,
 
   stopPropagation : stopPropagation,
 
}</source>
 
}</source>
</source>
 

Latest revision as of 14:56, 1 November 2013

[edit] Dom Event Publisher

var DomEventPublisher = {
  get(src, sEvent); // Static.
  addCallback(o, type, cb);
  removeCallback(o, type, cb, useCapture); 
  purgeEvents(obj, eventOrList);
}

[edit] Cross-browser DomEvent Adapter

var DomEvent = {
  getTarget : getTarget,
  getRelatedTarget : getRelatedTarget,
  preventDefault : preventDefault,
  stopPropagation : stopPropagation,
}
Personal tools