Once created driven by our AdServer, the texts will change based on established parameters (Geolocation, weather, date/time, cookies, retargeting…).
To dynamize texts you have 4 methods at your service :
The setText function allows you to insert a text in an element.
ADventori.Display.setText(element, data);
This function needs two parameters:
The adaptText function allows you to adapt the text size to its container.
ADventori.Display.adaptText(element, minFontSize);
This function needs two parameters:
The HTML tag targeted by this function must be a block element and have the following CSS properties: width
, height
, font-size
, line-height
.
To use the adaptText method, the container which uses this method can’t use the CSS property display:none
(please use opacity:0;visibility:hidden;
).
The setAndAdaptText function allows you to combine the two previous functions.
ADventori.Display.setAndAdaptText(element, data, minFontSize);
This function needs three parameters:
The HTML tag targeted by this function must be a block element and have the following CSS properties: width
, height
, font-size
, line-height
.
To use the setAndAdaptText method, the container which uses this method can’t use the CSS property display:none
(please use opacity:0;visibility:hidden;
).
You can also define the size of your container directly from the method setAndAdaptText:
ADventori.Display.setAndAdaptText(element, data, minFontSize, {width:XXX,height:XXX})
;
The verticalAlign function allows you to vertically align the text in its container.
ADventori.Display.verticalAlign(element);
This function needs one parameter:
The HTML tag targeted by this function must be a block element and have the following CSS properties: width
, height
, font-size
, line-height
.
To use the adaptText method, the container which uses this method can’t use the CSS property display:none
(please use opacity:0;visibility:hidden;
).