Warning: The author of this contribution does not provide support for it anymore.

Advertisement Management

Rotating images in Ad manager - Advertisement Management

Rotating images in Ad manager

by huddy » Wed Sep 17, 2014 8:24 am

As per title, can someone point my in the right direction on how to achieve this.

Thanks.
huddy
Registered User
Posts: 163
Joined: Fri Feb 21, 2014 12:21 pm
Location: Chelmsford UK
Contact:

Re: Rotating images in Ad manager

by huddy » Wed Sep 17, 2014 10:21 am

sorted by adding more than one banner in the same location.
huddy
Registered User
Posts: 163
Joined: Fri Feb 21, 2014 12:21 pm
Location: Chelmsford UK
Contact:

Re: Rotating images in Ad manager

by pollos » Sun Jan 11, 2015 9:11 pm

The javascript below works well.

Code: Select all

<script language="JavaScript">
   <!-- Ad code goes here -->
<!--
function random_adlinks(){
  var adimages=new Array()
  //specify random images below. You can have as many as you wish
  adimages[1]="http://path.to.image"
  adimages[2]="http://path.to.image"
  adimages[3]="...............f"
 
  //specify corresponding links below
  var adlinks=new Array()
  adlinks[1]="http://ad.link"
  adlinks[2]="http://ad.link"
  adlinks[3]="........."
     
  var adtext=new Array()
  adtext[1]="Ad text."
  adtext[2]="Ad text"
  adtext[3]="................"
  a.
 
  var ry=Math.floor(Math.random()*adlinks.length)

  if (ry==0)
     ry=1
     document.write('<center>'+'<a href='+'"'+adlinks[ry]+'"'+'><img src="'+adimages[ry]+'" border=0></a>'+'<br />'+''+adtext[ry]+''+'</center>')
}

  random_adlinks()
//-->
</script>

        <!-- Ad code goes here -->
My sig should go here... but I've nowt so say
User avatar
pollos
Registered User
Posts: 145
Joined: Wed Jul 30, 2003 7:44 pm
Location: Menorca
Contact: