170、下拉菜单弹出窗口

170、下拉菜单弹出窗口

脚本说明:

把如下代码加入<body>区域中

<script language="JavaScript">

<!--

DestinationAndTitle=new Array()

DestinationAndTitle[0]="http://www.7stk.com*网页特效代码"

DestinationAndTitle[1]="http://www.163.com*网易"

DestinationAndTitle[2]="http://www.sina.com.cn*新浪网"

DestinationAndTitle[3]="http://www.yahoo.com*雅虎"

DestinationAndTitle[4]="http://www.5460.net*中国同学录"

DestinationAndTitle[5]="http://www.7stk.com/1/index06.htm*天气预报代码"

 

Top=0;

Left=0;

Height=400;

Width=600;

//1 = yes, 0 = no

ToolBar=0;

Location=0;

Directories=0;

Status=0;

MenuBar=0;

Scroll=0;

Resize=0;

function PopUp(){

var url=document.F.S.options[document.F.S.options.selectedIndex].value;

if (url != ''){

 if  (!window.popupwin || popupwin.closed)

 popupwin=open(url,"","top="+Top+",left="+Left+",width="+Width+",height="+Height+",status="+Status+",directories="+Directories+",location="+Location+",toolbar="+ToolBar+",menubar="+MenuBar+"scrollbars="+Scroll+",resizable="+Resize+"");

 else{

 popupwin.close();

 popupwin=open(url,"","top="+Top+",left="+Left+",width="+Width+",height="+Height+",status="+Status+",directories="+Directories+",location="+Location+",toolbar="+ToolBar+",menubar="+MenuBar+"scrollbars="+Scroll+",resizable="+Resize+"");

 }

}

else return false;

}

document.write("<form name='F'><select name='S' onchange=PopUp()> <option value='#'>请选择下面的链接</option>");

for (i=0; i < DestinationAndTitle.length; i++){

var urlMsg=DestinationAndTitle[i].split('*')

document.write("<option value="+urlMsg[0]+">"+urlMsg[1])}

document.write("</select></form>");

//-->

</script>

 

Write a comment

Comments: 0