193、导航按钮加说明

193、导航按钮加说明

脚本说明:

把如下代码加入<body>区域中:

<SCRIPT LANGUAGE="JavaScript">

 

<!-- Begin

function makeArray(q){

for(i=1 ; i < q ; i++){this[i]=0}}

w=1;

howmanysites=4; // How many sites are listed below?

 

Sites = new makeArray(howmanysites);

 

<!-- STEP TWO: Use the pattern:  url~Site Title|Description for links  -->

 

Sites[1] = "http://www.163.com~网易|国内最大的综合站点--网易";

Sites[2] = "http://www.sina.com.cn~新浪网|国内最好的新闻站点--新浪网";

Sites[3] = "http://www.yahoo.com.cn~中方雅虎|中方雅虎";

Sites[4] = "http://www.7stk.com/~搜狐|国内最大的搜索引擎站点--搜狐";

 

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);

 

// You can change the speed!  3000 = 3 sec delay.  5000 = 5 sec delay, etc.

 

}

function visitSite() {

window.location=document.form.url.value;

}

// End -->

</SCRIPT>

<form name=form>

<table><tr><td align=center>

<input type=button name=name value="Visit" onClick="visitSite()" size=25>

<input type=hidden name=url value="">

<input type=text name=word value="" size=20>

</td></tr></table>

</form>

<script>

showSites();

</script>

 

Write a comment

Comments: 0