Images Dynamisation

DYNAMIZE AND ADAPT THE SIZE OF AN IMAGE

Documentation DCO Enabler -> ENABLER HTML5 -> DYNAMIZE AND ADAPT THE SIZE OF AN IMAGE

DYNAMIZE AND ADAPT THE SIZE OF AN IMAGE

 

It is possible to boost the images of your ad without them being distorded and keeping their full visibility .

To create a zone of dynamic’s images, add a uniqueid attribute, and set the values of the image (addAndAdaptImage) by default.

Once created driven by our AdServer, images change based on established parameters ( Geolocation, weather, date/time, cookies, retargeting …)

For this, you must give width and height to the div who contain your image in order to adapt the size.

 

Personalization methods available:

addImage(element,url,urldefault) : This method allows you to add an image to the specified container.
adaptImage(element,displayOption) : This method allows you to adjust the image size according to its container.
addAndAdaptImage(element,url,urldefault,displayOption) : This method allows you to add an image in a container and resize it to its container.

displayOption :

  • {fit:’cover’} : This option allorw you to cover the entire container with the image (if the picture is to big, it will be center without taking account the overflow).
  • {fit:’contain’} : This option allows you to display the entire image in its container, it’s the default option.
  • {with : size, height : size} : This options allows you to define the size of its container.

Example :

Other custom method available:

  • setImageUrl(element,url,urldefault) : This method lets you change the URL of an image tag.

Example :

 

You can also define the size of your container directly from the method adaptImage and addAndAdaptImage