Can you please help me make this banner display, display random banners instead of the first banner on the list every time ? THANKS ! var ImageCount = 5; // ***** Change this to the total number of images loaded above ***** // var ImageDelay = 6000; // ***** Set this to the delay interval desired. 5000 = 5 seconds. // var LinkTarget = "_self" // ***** Defines where you want linked page to open. _self, _blank, _top, etc // var ImageIndex = 0; // DO NOT ALTER // var FirstLoad = 0; // DO NOT ALTER // var QuickStartID = 0; // DO NOT ALTER // var htmlString = "" // DO NOT ALTER // // This function rotates the banner // function ImageChange() { htmlString = '<center>'; htmlString = htmlString + '<font face = "Verdana" size="2">'; // Font and Font Size for caption may be changed here // htmlString = htmlString +'<a target="_blank"'; htmlString = htmlString + LinkTarget; htmlString = htmlString + '" href="'; htmlString = htmlString + ImageLoad[ImageIndex][0]; htmlString = htmlString + '"><img border="0" src="'; // Image border size may be changed here // htmlString = htmlString + ImageLoad[ImageIndex][1]; htmlString = htmlString + '"></a><br>'; htmlString = htmlString + ImageLoad[ImageIndex][2]; htmlString = htmlString + '</font>'; htmlString = htmlString + '</center>'; document.getElementById('MagicImage').innerHTML = htmlString; if(ImageIndex == ImageCount - 1) // This statement increments image displayed and resets if displaying last image // { ImageIndex= 0; } else { ImageIndex++; } if(FirstLoad == 0) // Determins if this is the first time function has run. // { SlowFinish(); } } // End Funtion // // This function ensures first banner is displayted without a delay // function QuickStart() { QuickStartID=setInterval("ImageChange()", 1000); } // End Funtion // // This function sets display rate to user defined speed // function SlowFinish() { clearInterval(QuickStartID); FirstLoad = 1; setInterval("ImageChange()", ImageDelay); } // End Funtion // QuickStart()
just out of curitosity how does installing the random number code into this script prevent hackers ? and where do i place this ? my hosting company said some one somehow downloaded "malicious files" to my server ???
you should view & use these scripts: Random Ads, Random Background Image onLoad, Random background-image and more random image JavaScript
This SHOULD be what you're looking for; var ImageCount = 6; // ***** Change this to the total number of images loaded above ***** // var ImageDelay = 7000; // ***** Set this to the delay interval desired. 5000 = 5 seconds. // var LinkTarget = "_blank" // ***** Defines where you want linked page to open. _self, _blank, _top, etc // var ImageIndex = 0; // DO NOT ALTER // var FirstLoad = 0; // DO NOT ALTER // var QuickStartID = 0; // DO NOT ALTER // var htmlString = "" // DO NOT ALTER // var randomnumber = 0; // DO NOT ALTER // // This function rotates the banner // function ImageChange() { htmlString = '<center>'; htmlString = htmlString + '<font face = "Verdana" size="3">'; // Font and Font Size for caption may be changed here // htmlString = htmlString +'<a target="'; htmlString = htmlString + LinkTarget; htmlString = htmlString + '" href="'; htmlString = htmlString + ImageLoad[ImageIndex][0]; htmlString = htmlString + '"><img border="0" src="'; // Image border size may be changed here // htmlString = htmlString + ImageLoad[ImageIndex][1]; htmlString = htmlString + '"></a><br>'; htmlString = htmlString + ImageLoad[ImageIndex][2]; htmlString = htmlString + '</font>'; htmlString = htmlString + '</center>'; document.getElementById('MagicImage').innerHTML = htmlString; ImageIndex = Math.floor(Math.random()*ImageCount); if(FirstLoad == 0) // Determins if this is the first time function has run. // { SlowFinish(); } } // End Funtion // // This function ensures first banner is displayted without a delay // function QuickStart() { QuickStartID=setInterval("ImageChange()", 1000); } // End Funtion // // This function sets display rate to user defined speed // function SlowFinish() { clearInterval(QuickStartID); FirstLoad = 1; setInterval("ImageChange()", ImageDelay); } // End Funtion // QuickStart() Code (markup): Magic Image has since come out with a randomized script and I just got that yesterday - and if you could be so kind as to let me know if there is a way that I could hook this up with buttons (so the ss can advance/go to previous) - having a hard time figuring out what the placement is for; <script type="javascript/text"> <!-- Hide from old browsers function goHist(a) { history.go(a); } // --> </script> <FORM METHOD="post"> <INPUT TYPE="button" VALUE=" BACK " onClick="goHist(-1)"> <INPUT TYPE="button" VALUE="FORWARD" onClick="goHist(1)"> </form> Code (markup): Otherwise, I suspect that I'll have to go up a notch and start messin' with jQuery ("Easy Slider" 1.5) or that jClicker thing (I don't know......:lol. I just caught that reference to the fact that someone loaded your server with malicious files, so I think I'm going to be going with either the Easy Slider or jClicker - for the inbuilt security measures - investigate those 2, won't you? Hope this helped you.
it's none of my business but this question is an year and a half old, i am sure your help is appreciated nonetheless
it actually was VERY MUCH appreciated ! also mods go around and give out infractions for things like that, but it still helped me because in a year and a half NO ONE ELSE ANSWERED IT LOL see you guys later.