Rotating Banners
Many thanks to Mohsin for his help.
If you wish to insert more than one banner into your header for example, here is the code.
It works on jobroller and classipress so should work on all. Keep all three link, image and text lines the same. So if you have two banners in your rotation like my example you would only need to have two lines in each. Also don't forget to remove the comma for the last line. Like this
"Alt Text Goes Here for Banner 1",
"Alt Text Goes Here for Banner 2"
If the comma is on the bottom line it will not work. If you wish more than two banners just add more lines using the same principals.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
<script>
var currentdate = 0;
var core = 0;
function initArray() {
this.length = initArray.arguments.length;
for (var i = 0; i < this.length; i++) {
this[i] = initArray.arguments[i];
}
}
link = new initArray(
"https://your link destination here",
"https://your link destination here"
);
image = new initArray(
"http://your image location here",
"https://your image location here"
);
text = new initArray(
"Alt Text Goes Here for Banner 1",
"Alt Text Goes Here for Banner 2"
);
var currentdate = new Date();
var core = currentdate.getSeconds() % image.length;
var ranlink = link[core];
var ranimage = image[core];
var rantext = text[core];
document.write('<a target="_blank" href="' +ranlink+ '"><img src="'+ranimage+'" border="1" alt="'+rantext+'"></a>');
//-->
</SCRIPT>