?? 3.16 文本框滾動導航.htm
字號:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>標題頁</title>
</head>
<body>
<SCRIPT LANGUAGE="JavaScript">
function makeArray(q){
for(i=1 ; i < q ; i++){this[i]=0}} //設置從1開始的數組
w=1;
howmanysites=4; // 顯示導航的內容個數
Sites = new makeArray(howmanysites);//設置導航數組
Sites[1] = "http://www.google.com|全球的搜索引擎!"; //以“|”間隔站點和描述
Sites[2] = "http://www.baidu.com|中國的搜索引擎!";
Sites[3] = "http://www.yahoo.com|還有一個搜索引擎!";
function showSites() {
if (w > howmanysites) { w=1; }; //如果導航到結尾,則從頭開始
var string=Sites[w] + "";
var split=string.indexOf("|"); //通過間隔符分組
var url=string.substring(0,split);
var word=string.substring(split + 1,string.length);//獲取鏈接的描述
document.form.url.value=url; //獲取鏈接的Url地址
document.form.word.value=word;
w+=1;
window.setTimeout('showSites()',5000); //每隔5秒鐘改變一下鏈接
}
function visitSite() {
window.location=document.form.url.value; //導航到指定位置
}
</SCRIPT>
<center>
<form name=form>
<table><tr><td align=center>
<input type=hidden name=url value="">
<input type=text name=word value="" onFocus="visitSite()" size=40>
</td></tr></table>
</form>
</center>
<script>
showSites();
</script>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -