请输入您要查询的百科知识:

 

词条 jumpMenu
释义

jumpMenu 表单中的跳转菜单控件。

在DW中选择跳转菜单,DW会自动生成一个单表

例如:

<form name="form" id="form">

<select name="jumpMenu" id="jumpMenu" onchange="MM_jumpMenu('parent',this,0)">

<option>项目1</option>

<option>项目1</option>

<option>项目1</option>

</select>

</form>

同事会创建一个JS函数:

<script type="text/javascript">

function MM_jumpMenu(targ,selObj,restore){ //v3.0

eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");

if (restore) selObj.selectedIndex=0;

}

</script>

项目1 可以替换成你所要求的内容。这样调用时直接在本页面跳转。 如果你想实现在新窗口中打开:就要用到window.open

<script type="text/javascript">

<!--

function MM_jumpMenu(targ,selObj,restore){ //v3.0

eval(targ+".open('"+selObj.options[selObj.selectedIndex].value+"')"); /*改变

if (restore) selObj.selectedIndex=0;

}

//-->

</script>

<html>

<form name="form" id="form">

<select name="menu1" onChange="MM_jumpMenu('window',this,0)">

<option value="#" selected>链接1</option>

<option value="#">链接2</option>

<option value="#">链接3</option>

</select>

</form>

</html>

随便看

 

百科全书收录4421916条中文百科知识,基本涵盖了大多数领域的百科知识,是一部内容开放、自由的电子版百科全书。

 

Copyright © 2004-2023 Cnenc.net All Rights Reserved
更新时间:2025/2/12 16:59:08