Does the widget work with infinite scroll?
Updated by Joakim
Yes it does, but you need to make some small changes to our tags and depending if you are using a v1 or v2 widget.
Add the script to the <head> section of the webpage.
For every instance of the widget add the following part with the widget's id and corresponding class name.
To implement a widget on a page with infinite scroll, you have to add the div part of the widget as many times as you want it to appear. Please note that you have to change the class name for each instance!
<script async src="https://assets.strossle.com/strossle-widget-sdk/1/strossle-widget-sdk.js"></script>
For each of the widget instances, add a div tag with its corresponding class name where you want it to appear.
When your site loads the next article after the previous one and the url changes automatically ('infinite scroll'), you will need to send the url in our script.
This is done by adding a parameter 'data-spklw-url="..."', where you will have to add the url of the current article. Example:
<div data-spklw-widget="widget-1234567890" data-spklw-url="https://www.bt.dk/danmark/storcenter-i-ombygning"></div>
The script tag has to contain an attribute 'data-spklw-automatic-initialization'.
When this attribute has been added, the script will initialize widgets even if the widget div is added after the initial page load.
Please be sure to load the script tag only once per page.
The script tag should look like this:
<script data-spklw-automatic-initialization src="//widgets.sprinklecontent.com/v2/sprinkle.js" async></script>