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) – adds an event listener.
  • once(type, callback) – adds an event listener and removes him after the event fires.
  • off(type, callback) – removes an event listener.

Currently, the following public events are implemented:

  • pageLoadComplete – fires when a page is loaded. This event is used commonly to set up polite banners.
  • show – fires when an asset has been shown.
  • hide – fires when an asset has been hidden.

An example of a polite banner:

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