Contextly triggers the following events on the window object:
* contextlyWidgetsLoaded
* contextlyWidgetsFailed
* contextlyWidgetsDisplayed
We also trigger the following events for each rendered module:
* contextlyWidgetDisplayed
Arguments for this specific event are:
* Event object
* Widget type: 'snippet', 'sidebar', 'auto-sidebar' or 'storyline-subscribe'
* Widget class instance
For example, to catch a moment right after widgets HTML is injected into the page, you could use the following code:
$(window).bind('contextlyWidgetsDisplayed', function() {
// Custom code here
});
Note: There is only one caveat about these events. Modules may rendered without the CSS loaded and then appear differently after the CSS is loaded. This problem will be resolved soon.
Comments