Skip to content

Instantly share code, notes, and snippets.

@mihdan
Forked from atronov/widget.js
Created April 30, 2019 17:49
Show Gist options
  • Select an option

  • Save mihdan/e6093ae9a3e7028167efcc5730d66af0 to your computer and use it in GitHub Desktop.

Select an option

Save mihdan/e6093ae9a3e7028167efcc5730d66af0 to your computer and use it in GitHub Desktop.
widget
(function(w, n) { w[n]
= w[n] || [];
w[n].push(() => {
w.YandexZen.renderWidget({
clid: ['9110', '9111'], // partner's identifier (for testing purposes only)
container: '.widget-container', // element selector or dom-element where the widget will be inserted
successCallback: function () { // called when the widget is inserted successfully
console.log('widget mount succeed'); // replace function body with your handler or delete this field
},
failCallback: function () { // called in case of problem while widget insertion
console.log('widget mount failed'); // replace function body with your handler or delete this field
},
// this property hides shadow at edges and add some extra margins
needEdges: false,
});
});
})(window, 'yandexZenAsyncCallbacks');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment