Skip to content

Instantly share code, notes, and snippets.

@atronov
Created October 16, 2017 16:20
Show Gist options
  • Select an option

  • Save atronov/3acaf3f1cb52fff1dd9f0adb93caed08 to your computer and use it in GitHub Desktop.

Select an option

Save atronov/3acaf3f1cb52fff1dd9f0adb93caed08 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