|
↑
Menus and Navigation >>>
This neat little JavaScript will flip through all the different sites that you include, along with a description of that site. When the visitor clicks the button, they are taken to that site!
Add the below code to the <body> section of your page:
<script
language="javascript"
type="text/javascript">
function
makeArray(q){
for(i=1
;
i <
q ;
i++){this[i]=0}}
w=1;
howmanysites=4;
Sites
=
new
makeArray(howmanysites);
Sites[1]
=
"http://yaldex.com/JSFactory_Pro.htm~JavaScript Editor|Get the best
JavaScript Editor!";
Sites[2]
=
"http://www.yaldex.com~Many
JavaScript Programs|Click to get many JavaScript programs!";
Sites[3]
=
"http://www.google.com~Google!|Click for fastest Search Engine!";
Sites[4]
=
"http://www.yahoo.com~Yahoo!|Click for the greatest Search Engine!";
function
showSites()
{
if
(w
>
howmanysites)
{
w=1;
};
var
string=Sites[w]
+
"";
var
split1=string.indexOf("~");
var
split2=string.indexOf("|");
var
url=string.substring(0,split1);
var
name=string.substring(split1
+
1,split2);
var
word=string.substring(split2
+
1,string.length);
document.form.url.value=url;
document.form.name.value=name;
document.form.word.value=word;
w+=1;
window.setTimeout('showSites()',3000);
}
function
visitSite()
{
window.location=document.form.url.value;
}
</script>
<form
name=form>
<table><tr><td
align=center
nowrap>
<input
type=button
name=name
value="Visit
these sites!"
onClick="visitSite()"
size=25>
<input
type=hidden
name=url
value="">
<input
type=text
name=word
value=""
size=40>
</td></tr></table>
</form>
<script>
showSites();
</script>
|
→
|