PDA

View Full Version : Button Rotations


Skeena
07-18-2008, 04:45 PM
How do I do button rotations on i-frame?
Like whenever you move to another page it changes?

Christine
07-18-2008, 05:10 PM
I don't thin you can do that with iframes, if you're putting the buttons in your menu..But if you put it on the footer of each page, it should change every time you go to a new page.

Skeena
07-18-2008, 05:20 PM
Thats gonna take foreverrr lol, but can I still have the link please since the layout's changing soon!

Christine
07-18-2008, 05:41 PM
<SCRIPT LANGUAGE="JavaScript">
var theImages = new Array()

//Random-loading images
theImages[0] = 'images/home_rotate1.gif' // replace with names of images
theImages[1] = 'images/home_rotate2.gif' // replace with names of images
theImages[2] = 'images/home_rotate3.gif' // replace with names of images
theImages[3] = 'images/home_rotate4.gif' // replace with names of images

var j = 0
var p = theImages.length;
var preBuffer = new Array()

for (i = 0; i < p; i++){
preBuffer[i] = new Image()
preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));

function showImage(){
if(whichImage==0){
document.write('<a href ="link.html"><img src="'+theImages[whichImage]+'" border=0 width=452 height=181></a>');
}
else if(whichImage==1){
document.write('<a href ="link.html"><img src="'+theImages[whichImage]+'" border=0 width=452 height=181></a>');
}
else if(whichImage==2){
document.write('<a href ="link.html"><img src="'+theImages[whichImage]+'" border=0 width=452 height=181></a>');
}
else if(whichImage==3){
document.write('<a href ="link.html"><img src="'+theImages[whichImage]+'" border=0 width=452 height=181></a>');
}
else if(whichImage==4){
document.write('<a href ="link.html"><img src="'+theImages[whichImage]+'" border=0 width=452 height=181></a>');
}

}

</script>

then this goes wherever you want the buttons to show:
<script>showImage();</script>

accionatty!
07-18-2008, 05:44 PM
Do you use PHP or HTML? Because if you use PHP it should only take like 4 minutes lol :P

Skeena
07-18-2008, 05:45 PM
Thanks christine!
^_~

Do you use PHP or HTML? Because if you use PHP it should only take like 4 minutes lol :P

Both
xD
msg2short

Viktoria
07-18-2008, 07:23 PM
How do you use HTML and PHP simultaniously? xD

Skeena
07-19-2008, 05:55 AM
IDK my partner does it lol. But we use cutenews to add our things and html for html. Hard to explain

vasilios
07-19-2008, 06:35 PM
How do you use HTML and PHP simultaniously? xD

Very easily.