作者porphur (我要看RENT)
看板Web_Design
标题[问题] 请问下拉式跳页选单的连结(已爬文)
时间Sun Jan 1 17:19:09 2006
我在我的blog加上几个下拉式跳页选单
我想要按下选项之後在新视窗开启
可是在<option>里加入target="_blank"了
却还是在同一个页面换页
请问要怎样改成可以在新视窗开启呢?
我的原始码:
1. 贴在<head>...</head>中间的:
<SCRIPT TYPE="text/javascript">
<!--
function dropdown(mySel)
{
var myWin, myVal;
myVal = mySel.options[mySel.selectedIndex].value;
if(myVal)
{
if(mySel.form.target)myWin = parent[mySel.form.target];
else myWin = window;
if (! myWin) return true;
myWin.location = myVal;
}
return false;
}
//-->
</SCRIPT>
2. 贴在<body>....</body>中间的:
<SELECT ONCHANGE="location = this.options[this.selectedIndex].value;">
<OPTION VALUE="">Choose a Musical...
<OPTION VALUE="
http://www.avenueq.com/" target="_blank">-- Avenue Q
<OPTION VALUE="
http://www.fossethemusical.com/" target="_blank">-- Fosse
<OPTION VALUE="
http://www.hairsprayonbroadway.com/" target="_blank">--
Hairspray
<OPTION VALUE="
http://disney.go.com/disneytheatrical/thelionking/"
target="_blank">-- Lion King, the
<OPTION VALUE="
http://www.montypythonsspamalot.com/" target="_blank">-- Monty
Python's Spamalot
<OPTION VALUE="
http://www.musicals.nl/passion/" target="_blank">-- Passion
<OPTION VALUE="
http://www.producersonbroadway.com/" target="_blank">--
Producers, the
<OPTION VALUE="
http://www.siteforrent.com/" target="_blank">-- Rent
<OPTION VALUE="
http://www.reallyuseful.com/rug/shows/sunset/"
target="_blank">-- Sunset Boulevard
<OPTION VALUE="
http://www.modernmillietour.com/" target="_blank">--
Thoroughly Modern Millie
</SELECT>
感谢各位!!!
--
AMETHYSTOPHILE
我爱紫水晶
http://amethystophile.blogspot.com/
编码记得调成unicode才能看
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.59.122.160
※ 编辑: porphur 来自: 61.59.122.160 (01/01 17:57)