Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Button Rotations!
couture threat
post Feb 5 2006, 03:28 AM
Post #1


Newbie
*

Group: Members
Posts: 8
Joined: 5-February 06
Member No.: 18,223



You know when you refresh a page and an image changes? Well it's called a rotation.

Here's how to do it:

QUOTE
<script LANGUAGE="JavaScript">
<!-- Begin
var how_many_ads = 2;
var now = new Date()
var sec = now.getSeconds()
var ad = sec % how_many_ads;
ad +=1;
if (ad==1) {
url="http://domain.org";
alt="Domain Name";
banner="http://buttonURL.com";
width="88";
height="31";
}
if (ad==2) {
url="http://domain.org/";
alt="Domain Name";
banner="http://buttonURL.com";
width="88";
height="31";
}


document.write('<a href=\"' + url + '\" target=\"_blank\">');
document.write('<img src=\"' + banner + '\" width=')
document.write(width + ' height=' + height + ' ');
document.write('alt=\"' + alt + '\" border=0></a>');
// End -->
</SCRIPT>


var how_many_ads = 2; Change the number 2 to however many buttons you have.
if (ad==1) { That means that's button number one. If you have 2 buttons, It would say ' if (ad==2) { ' etc.
url="http://domain.org"; change http://domain.org to the domain url of the button you are linking, so that if you click on the button, it'll link to its correct url.
alt="Domain Name"; If you hover over the button, it'll say whatever is in quotes. Change domain name.
banner="http://buttonURL.com"; change that link to the image url of the button.
width="88"; height="31"; This is just the width and height of all your buttons. Meaning all your buttons must be this size. You can change it to any number.



Easy as that! biggrin.gif

Claps for Kellie!
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Delphi Tutorial - Change Your Start Button Caption(4)


 



- Lo-Fi Version Time is now: 26th July 2008 - 02:04 PM