PDA


View Full Version : Imagen on header


pikapin
05-27-2005, 01:28 PM
Hello,

I have this image on header TodoMini (http://www.todomini.com/cmps_index.php) (Itīs my future web, after I migrate from phpbb)

Iīd like to change the image each certain amount of time. What I mean is if I can schedule when or how often to change the image. Iīd like to do it each week.

Thanks a lot

Carlos

mholtum
05-27-2005, 04:24 PM
you need some sort of rotating banner script

pikapin
05-27-2005, 04:26 PM
Yes, itīs what I need but I donīt know how customizable are they...

mholtum
05-27-2005, 09:06 PM
I would try to find a couple. Generally you can set a delay in the code.

FightRice
05-27-2005, 10:12 PM
Try this
Open an empty text document with your editor which you later on will save as "rotation-script.js". Then copy and paste the following code.



function randInt(min,max)
{
var div = (max - min) + 1
var randNum = Math.random()
for (var i = 0; i <= div - 1; i++)
{
if (randNum >= i / div && randNum < (i+1) / div)
{return i + min}
}
}


var abc = randInt(1,5);

if (abc == 1) {

document.write("<\"Your 1. HTML-Banner-Code\">");

}

if (abc == 2) {

document.write("<\"Your 2. HTML-Banner-Code\">");

}

if (abc == 3) {

document.write("<\"Your 3. HTML-Banner-Code\">");

}

if (abc == 4) {

document.write("<\"Your 4. HTML-Banner-Code\">");

}

if (abc == 5) {

document.write("<\"Your 5. HTML-Banner-Code\">");

}







Documentation:
The function "randInt" is called to define a random number from 1 to 5. Then the script writes the HTML-Code of one of your banners to your website. It is that easy!

Always use backslashes in your HTML-Code when you use the JavaScript function "document.write("");" to write to your pages.

As stated above save the text file as "rotation-script.js". You can integrate this script in your HTML-documents with:

<script language="JavaScript" type="text/javascript" src="rotation-script.js">

FightRice
05-27-2005, 10:14 PM
also, http://www.hotscripts.com

pikapin
06-02-2005, 06:32 PM
Thanks guys !!! Iīll try that code

regards

KW802
06-02-2005, 07:02 PM
Pikapin,

Do you want just a random graphic or are you actually talking about changing the HTML code as well?

pikapin
06-03-2005, 05:11 PM
Pikapin,

Do you want just a random graphic or are you actually talking about changing the HTML code as well?

No, just the images.. .why?