Text Dynamisation

ADAPT THE TEXT SIZE

Documentation DCO Enabler -> ENABLER HTML5 -> ADAPT THE TEXT SIZE

ADAPT THE TEXT SIZE

 

If you want to insert dynamic text in your advertising, but this text may take, in some cases more space than the space reserved for it in its Div, you can use theadaptTextmethod.

The adaptText method reduced the font size on a given element , “10” is the minimum accepted size.

The reduction factor optimizes the display and adjusts the font size according to the space for the text field.

In cases where the entire text does not fit in the slot reserved for it and its font size is 15px, then the method will reduced it to 10px.

If the text is still too long following the reduction, non-displayed characters will be summarized by “…”

 

To adjust the text size of a div:

 

To adjust the text size of a div (class):

<div class="wording">
< Default text >
</div>
<script type="text/javascript"> ADventori.Display.adaptText(document.getElementsByClassName('wording'), 10); </script>

 

You want to dynamize and adapt your text directly ? The method setAndAdaptText is made for you :

Similary, you can apply this features to elements of a class :

<div class="wording">
< Default text>
</div>
<script type="text/javascript"> ADventori.Display.setAndAdaptText(document.getElementsByClassName('wording'),demo.wording, 10); </script>


You can also define the size of your container directly from the method setAndAdaptText

ADventori.Display.setAndAdaptText(document.getElementById('ADventori_text1'),ADventori.data.wording, 10, {width:270,height:160});