火影忍者疾风传观看:下拉表单如何执行js函数

来源:百度文库 编辑:中科新闻网 时间:2024/05/06 03:01:12
例如有一组函数
<Script Language="JavaScript">
IEver=navigator.appVersion.substring(navigator.appVersion.indexOf('MSIE')+5,navigator.appVersion.indexOf(';',17));
if(IEver=="6.0")
{
ie6 = true;
width_add = 10;
height_add = 29;
hand_add = -14;
}
else
{
ie6 = false;
width_add = 0;
height_add = 0;
hand_add = 0;
}
function OpenWindow(PlayerURL)
{
if (ie6)
newwindow=window.open('','Looking','fullscreen=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=-1');
else
newwindow=window.open('','Looking','fullscreen=1,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0');
newwindow.moveTo(100,100);
newwindow.resizeTo(440+width_add,428+height_add+hand_add);
newwindow.focus();
newwindow.location=PlayerURL;
}
function Play(id)
{
OpenWindow('look.asp?id='+id);
}
</Script>

<a href='javascript:Play(1)' class=bg><font color=#ffffff>播放</font></a>
就可以打开窗口
如果要用下拉菜单怎么实现?

<select onchange="Play(this.options[this.selectedIndex].value)">
<option value="1">第一个</option>
<option value="2">第二个</option>
</select>