Matt Ceaser
-
Posts
4 -
Joined
Posts posted by Matt Ceaser
-
-
All I can say, you guys are awesome. Got it working with:
<script language="JavaScript">
<!--
function random_imglink(){
var myimages=new Array()
//specify random images below. You can have as many as you wish
myimages[1]="Image1"
myimages[2]="Image2"
myimages[3]="Image3"
var ry=Math.floor(Math.random()*myimages.length)
if (ry==0)
ry=1
document.write('<img src="'+myimages[ry]+'" border=0>')
}
random_imglink()
//-->
</script>
Added it to the custom content page, and wallah, it works!
Thank you all for your help. Now to make images link to hrefs.
-
No, I am not getting it to work. Found script online and added our images. Tried several scripts, from online resources. Cannot get any to work?
Also tried adding the j after $, also did not work.
-
Does anyone know how I can generate a new image on page refresh. We have a client who would like a banner, but would like it to show a different image on page reload/refresh.
I am relatively new to Marcom, so excuse my ignorance.
What I am trying:
Made a js page with the below js:
var image = new Array ();
image[0] = "https://files.marcomcentral.app.pti.com/jtd/shared/Images/fpo/jobdirect.jpg";
image[1] = "https://files.marcomcentral.app.pti.com/jtd/shared/Images/fpo/expressions.jpg";
image[2] = "https://files.marcomcentral.app.pti.com/jtd/shared/Images/fpo/fb1_mainbanner.png";
var size = image.length
var x = Math.floor(size*Math.random())
$('#randombanner').attr('src',image[x]);
Added this to the Custom content=>Home Page
<img id='randombanner'/>
Nothing happens, please tell me what I am doing wrong.
Random image/banner on page refresh
in MarcomCentral®
Posted
Got the links also, thanks again for everyones help!
<script language="JavaScript">
<!--
function random_imglink(){
var myimages=new Array()
//specify random images below. You can have as many as you wish
myimages[1]="Image1"
myimages[2]="Image2"
myimages[3]="Image3"
//specify corresponding links below
var imagelinks=new Array()
imagelinks[1]="Link1"
imagelinks[2]="Link2"
imagelinks[3]="Link3"
var ry=Math.floor(Math.random()*myimages.length)
if (ry==0)
ry=1
document.write('<a href='+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" border=0></a>')
}
random_imglink()
//-->
</script>