From September, Flash will no longer be supported by Chrome. Prepare for the shift towards HTML5 by visiting our Flash to HTML5 help page

Check it out!

Shared Events

If you want to listen to banner-specific events, you can use dhtml.sharedEvents object to add or remove event listeners.

  • on(type, callback) - add event listener.
  • once(type, callback) - add event listener, and remove after it fires.
  • off(type, callback) - remove event listener.

Currently, there are the following public events implemented:

  • pageLoadComplete - fires when a page is loaded, this event is used commonly to setup polite banners;
  • show - fires when an asset has been shown;
  • hide - fires when an asset has been hidden.

Example for polite banners:

dhtml.sharedEvents.once('pageLoadComplete', function() {
    // traffic-heavy code here