Native Ads retrieved from a single client-side call can be allocated to several DIV containers on your website. Each container can display one or more ads. If a container's designated ad(s) are unavailable, the container will automatically be hidden using display: none
.
Additionally, each container can be individually styled to match your website's design.
Please note: This script is exclusively for Native Ads, not for banners.
<div id="solads-adverts">
, must remain unchanged.<!-- SOLADS-ADVERT -->
<div id="solads-adverts">
<script type="text/javascript" data-params="jsads">
m3ads_system = "Solads";
m3ads_partnernumber = 1234;
m3ads_sectors = "1234";
m3ads_numberadverts = 4;
m3ads_logoimagewidth = 240;
m3ads_logoimageheight = 120;
solads_Acontainer = [
[0,'solads-advert-n1','className',1],
[1,'solads-advert-n2','className',2],
[2,'solads-advert-n3','className',1]
];
solads_Acssurl = ['cdn.solads.media/css/as/728x90.min.css',
'cdn.solads.media/css/as/160x600.min.css'
];
solads_mode = "auto";
</script>
<script type="text/javascript" src="//cdn.feed.solads.media/resources/scripts/jsAds-1.4.min.js" async></script>
<script type="text/javascript" src="//cdn.solads.media/js/jsads-distribute-1.3.min.js" defer></script>
</div>
<!-- SOLADS-ADVERT-END -->
<html>
<body>
<div id="solads-advert-n1"></div>
<div id="solads-advert-n2"></div>
<div id="solads-advert-n3"></div>
</body>
</html>
<!-- SOLADS-ADVERT -->
<div id="solads-adverts">
<script type="text/javascript" data-params="jsads">
m3ads_system = "Solads";
m3ads_partnernumber = 1234;
m3ads_sectors = "1234";
m3ads_numberadverts = 4;
m3ads_logoimagewidth = 240;
m3ads_logoimageheight = 120;
solads_Acssurl = ['cdn.solads.media/css/as/728x90.min.css',
'cdn.solads.media/css/as/160x600.min.css'
];
solads_mode = "manual";
</script>
<script type="text/javascript" src="//cdn.feed.solads.media/resources/scripts/jsAds-1.4.min.js" async></script>
<script type="text/javascript" src="//cdn.solads.media/js/jsads-distribute-1.3.min.js" defer></script>
</div>
<!-- SOLADS-ADVERT-END -->
<html>
<body>
<div id="solads-advert-n1"></div>
<div id="solads-advert-n2"></div>
<div id="solads-advert-n3"></div>
<button onclick="sldsFillAdverts(0,'solads-advert-n1','className',1);">Anzeigen..</button><br />
<button onclick="sldsFillAdverts(1,'solads-advert-n2','className',2);">Anzeigen..</button><br />
<button onclick="sldsFillAdverts(3,'solads-advert-n3','className',1);">Anzeigen..</button>
</body>
</html>
Function | Details | Call |
---|---|---|
sldsFillAdverts | Triggers container to be filled with advert | sldsFillAdverts (First Advert-ID for this container (starting with Zero), DIV ID, DIV CLASS, Number pf Adverts) |
CustomEvent | Example |
---|---|
soladsLoaded |
|
Parameter | Typ | Format | Details |
---|---|---|---|
m3ads_numberadverts | Mandatory | Integer | Specify how many adverts are to be requested. This number should be the sum of the ads in the containers. |
solads_Acontainer | Mandatory | Array [Number (continuous, starting with zero), DIV ID, DIV CLASS, Number of Adverts] | Specify the details of the DIV containers that shall receive the adverts. Each container has a number (beginning with zero) in the array and a unique ID. Then define the CSS class(es) of each container and how many adverts should be assigned to it. |
solads_Acssurl | Optional | Array (URL, URL, URL, etc.) | Specify the stylesheets to be loaded for display. |
solads_mode | Optional | String |
auto = Automatic advert distribution into containers that have been generated on pageload manual = Event-triggered loading of adverts into dynamically created containers |
solads_debug | Optional | Boolean | Set value to true for the debugging mode and load the script 'jsads-distribute-1.3.debug.js'. You will then receive error messages in the console. |