我在網上找了個仿 ;color:#ffffff;border-top:1pxsolid#FFFFFF;font-size:9pt;cursor:hand;}.contentStyle{background-color:#eeffee;color:blue;font-size:9pt;}a{color:blue;}body{font-size:9pt;}</style></head><body><scriptlanguage="JavaScript"><!--varlayerTop=20;//菜單頂邊距 var layerLeft=30; //菜單左邊距 var layerWidth=140; //菜單總寬 var titleHeight=20; //標題欄高度 var contentHeight=200; //內容區高度 var stepNo=10; //移動步數,數值越大移動越慢 var itemNo=0;runtimes=0; document.write('<span id=itemsLayer style="position:absolute;overflow:hidden;border:1px solid #008800;left:'+layerLeft+';top:'+layerTop+';width:'+layerWidth+';">'); function addItem(itemTitle,itemContent){ itemHTML='<div id=item'+itemNo+' itemIndex='+itemNo+' style="position:relative;left:0;top:'+(-contentHeight*itemNo)+';width:'+layerWidth+';"><table width=100% cellspacing="0" cellpadding="0">'+ '<tr><td height='+titleHeight+' onclick=changeItem('+itemNo+') class="titleStyle" align=center>'+itemTitle+'</td></tr>'+ '<tr><td height='+contentHeight+' class="contentStyle">'+itemContent+'</td></tr></table></div>'; document.write(itemHTML); itemNo++; } //添加菜單標題和內容,可任意多項,注意格式: addItem('歡迎','<BR>  歡迎光臨設計在線!'); addItem('網頁陶吧','<center><a href="#">網頁工具</a> <BR><BR><a href="#">技術平臺</a> <BR><BR><a href="#">設計理念</a> <BR><BR><a href="#">更多</a></center>'); addItem('美工教室','<center><a href="#">平面設計 </a> <BR><BR><a href="#">三維空間</a> <BR><BR><a href="#">設計基礎</a> <BR><BR><a href="#">更多..</a></center>'); addItem('Flash','<center><a href="#">基礎教程</a> <BR><BR><a href="#">技巧運用</a> <BR><BR><a href="#">實例剖析</a> <BR><BR><a href="#">更多..</a></center>'); addItem('多媒體','<center><a href="#">DIRECTOR</a> <BR><BR><a href="#">Authorware</a> <BR><BR><a href="#">更多..</a></center>'); addItem('精品賞析','<center><a href="#">設計精品</a></center>'); document.write('</span>') yle.height=itemNo*titleHeight+contentHeight; toItemIndex=itemNo-1;onItemIndex=itemNo-1; function changeItem(clickItemIndex){ toItemIndex=clickItemIndex; if(toItemIndex-onItemIndex>0) moveUp(); else moveDown(); runtimes++; if(runtimes>=stepNo){ onItemIndex=toItemIndex; runtimes=0;} else setTimeout("changeItem(toItemIndex)",10); } function moveUp(){ for(i=onItemIndex+1;i<=toItemIndex;i++) eval(' em'+i+'. p=parseInt( em'+i+'. p)-contentHeight/stepNo;'); } function moveDown(){ for(i=onItemIndex;i>toItemIndex;i--) eval(' em'+i+'. p=parseInt( em'+i+'. p)+contentHeight/stepNo;'); } changeItem(0); //--> </script> </body> </html> 問題1:為什么該腳本不能在Dreamwevar MX2004的設計視圖里進行編輯?問題2:為什么該腳本不能在IE6.0.2900中顯示出來?而只能在傲游、QQ流暢器中顯示出來?問題3:怎么為該腳本內的文字增加超級鏈接?

熱心網友

1.腳本非頁面表示元素。自然在設計視圖中無法顯示。代碼中的一些HTML代碼要注意它作為document.write方法的值的形式存在的,document.write(字符串值),字符串值可以是任何字符(基本可以認為),也可以是HTML代碼)。2.IE6.0中是可以正常顯示出來,至少我的機子上這樣的,連傲游(使用的是IE核心)都可以顯示出來,IE6.0就更能顯示出來了。3.文字 ,可以在CSS視圖中對它進行自定樣式處理(向導)。