請用IE6.0或更新版本觀看語法特效展示
將以下程式碼複製,貼在<head>及</head>標籤之間。
<!------------ 插入控制碼區段開始 ------------>
<script language="JavaScript1.2">
function move(x) {
if (document.all) {
object1.style.pixelLeft += x;
object1.style.visibility = "visible"}
else if (document.layers) {
document.object1.left += x;
document.object1.visibility = "show"}};
function makeStatic() {
if (document.all) {object1.style.pixelTop=document.body.scrollTop+20} //指定選單的上緣位置
else {eval(document.object1.top=eval(window.pageYOffset+20));}
setTimeout("makeStatic()",0);}
</script>
<style>
<!--
.hl { <!------------ 插入控制碼區段開始 ------------> <script language="JavaScript1.2"> function positionmenu(){ if (document.all) {document.write('<DIV ID="object1" style="visibility:hidden;cursor:hand; Position : Absolute ;Left : 0px ;Top : 20px ;Z-Index : 20" onmouseover="move(132)" onmouseout="move(-132)">')} <table border="0" cellpadding="0" cellspacing="1" width="150" bgcolor="#000000"> <script language="JavaScript1.2"> </tr> <script language="JavaScript1.2"> var text=new Array(); //configure thelinks below. Extend as desired
Background-Color : yellow;
Cursor:hand;
}
.n {
Cursor:hand;
}
-->
</style>
<!------------ 插入控制碼區段結束 ------------>
將以下程式碼複製,貼在<body>及</body>標籤之間。
<LAYER visibility="hide" top="20" name="object1" bgcolor="black" left="0" onmouseover="move(132)" onmouseout="move(-132)">
move(-132)
}
</script>
<tr><td bgcolor="#0099FF"> <font size="4" face="Arial"><b>Menu</b></font></td>
document.write('<td align="center" rowspan="100" width="16" bgcolor="#FF6666"><span style="font-size:13px"><p align="center"><font face="Arial Black">S<br>I<br>D<br>E<br>M<br>E<br>N<BR>U</font></p></span></TD>')
</script>
<!--
if (document.all||document.layers) {
makeStatic();}
var thelink=new Array();
text[0]="紫蓮の翼";
text[1]="Yahoo!奇摩";
text[2]="網路家庭";
text[3]="新浪網";
text[4]="yam天空";
text[5]="痞客邦";
//注意上下兩者排列順序的值須相同 //enter target of above links ///DO NOT EDIT BELOW THIS LINE//////////////// function navigateie(which){ for (i=0;i<=text.length-1;i++) //-->
thelink[0]="http://como0925.pixnet.net/blog";
thelink[1]="http://tw.yahoo.com/";
thelink[2]="http://www.pchome.com.tw/";
thelink[3]="http://www.sina.com.tw/";
thelink[4]="http://www.yam.com/";
thelink[5]="http://www.pixnet.net/";
//Valid values are '', 'new', or '_blank' (where 'framename' is the name of the frame you wish the links to target)
var linktarget=''
if (linktarget=='')
window.location=thelink[which]
else if (linktarget=='new')
window.open(thelink[which])
else{
temp_var=eval("window.parent."+linktarget)
temp_var.location=thelink[which]
}
}
if (document.all) {document.write('<TR><TD height=20 bgcolor=white onclick="navigateie('+i+')" onmouseover="className=\'hl\'" onmouseout="className=\'n\'"><FONT SIZE=2 FACE=ARIAL> '+text[i]+'</FONT></TD></TR>')}
else {document.write('<TR><TD bgcolor="white"><ILAYER><LAYER HEIGHT="18" onmouseover="this.bgColor=\'yellow\'" onmouseout="this.bgColor=\'white\'" width=131><FONT SIZE=2 FACE=ARIAL> <A HREF="'+thelink[i]+'" target="'+linktarget+'" id="nounderline">'+text[i]+'</A></FONT></LAYER></ILAYER></TD></TR>')}
</script>
<tr>
<td bgcolor="#0099FF"><font size="1" face="Arial"> </font></td>
</TR>
</table>
<script language="JavaScript1.2">
if (document.all) {document.write('</DIV>')}
window.onload=positionmenu
</script>
</LAYER>
<!------------ 插入控制碼區段結束 ------------>

抱歉,想請問一下 程式碼中的「貼在BODY標籤裡面」要怎麼貼? <body "程式碼"> 像這樣嗎? (這樣貼我跑不動)@@ 懇請指導
很抱歉~上面的語法有一些錯誤,已經更正完畢。按照上面語法所示即可
請問,是否可以改成『按一下』開起選單,再按一下關閉選單的語法呢? 或是應該改哪些呢?感恩您喔
我剛剛改了一下上述的語法,可以按了,但是再次按下選單時會整個跑到右邊,不知道哪裡出錯了,是否可以請您幫忙看一下? <!------------ 插入控制碼區段開始 ------------> <script language="JavaScript1.2"> function move(x) { if (document.all) { object1.style.pixelLeft += x; object1.style.visibility = "visible"} else if (document.layers) { document.object1.left += x; document.object1.visibility = "show"}}; function makeStatic() { if (document.all) {object1.style.pixelTop=document.body.scrollTop+20} //指定選單的上緣位置 else {eval(document.object1.top=eval(window.pageYOffset+20));} setTimeout("makeStatic()",0);} </script> <!------------ 插入控制碼區段結束 ------------> </head> <body> <!------------ 插入控制碼區段開始 ------------> <LAYER visibility="hide" top="20" name="object1" bgcolor="black" left="0" onclick="move(830)" onclick="move(-830)"> <script language="JavaScript1.2"> function positionmenu(){ move(-800) } if (document.all) {document.write('<DIV ID="object1" style="visibility:hidden;cursor:hand; Position : Absolute ;Left : 0px ;Top : 20px ;Z-Index : 20" onclick="move(830)" onclick="move(-830)">')} </script> <table border="0" cellpadding="0" cellspacing="1"> <tr><td><script type="text/javascript" src="http://www.myfxbook.com/scripts/fxCalendar.js"></script></td> <script language="JavaScript1.2"> document.write('<td align="center" rowspan="100" width="16" bgcolor="#FF6666"><span style="font-size:13px"><p align="center"><font face="Arial Black">即<br>時<br>財<br>經<br>日<br>曆</font></p></span></TD>') </script> </tr> <tr> <td bgcolor="#0099FF"><font size="1" face="Arial"> </font></td> </TR> </table> <script language="JavaScript1.2"> if (document.all) {document.write('</DIV>')} window.onload=positionmenu </script> </LAYER>