mjc 发表于 2007-4-27 10:28:32

***综合类***可以快捷选择的下拉菜单

把下列代码加到网页的<body></body>标签之间 从google下载我的照片管理软件
要完成此效果需要三个步骤

第一步:把如下代码加入到<head>区域中

<script language="javascript">
<!-- begin
function selobj(formname,selname,textname,str) {
this.formname = formname;
this.selname = selname;
this.textname = textname;
this.select_str = str || '';
this.selectarr = new array();
this.initialize = initialize;
this.bldinitial = bldinitial;
this.bldupdate = bldupdate;
}

function initialize() {
if (this.select_str =='') {
for(var i=0;i<document.forms.options.length;i++) {
this.selectarr = document.forms.options;
this.select_str += document.forms.options.value+":"+
document.forms.options.text+",";
   }
}
else {
var temparr = this.select_str.split(',');
for(var i=0;i<temparr.length;i++) {
var prop = temparr.split(':');
this.selectarr = new option(prop,prop);
   }
}
return;
}
function bldinitial() {
this.initialize();
for(var i=0;i<this.selectarr.length;i++)
document.forms.options = this.selectarr;
document.forms.options.length = this.selectarr.length;
return;
}

function bldupdate() {
var str = document.forms.value.replace('^\\s*','');
if(str == '') {this.bldinitial();return;}
this.initialize();
var j = 0;
pattern1 = new regexp("^"+str,"i");
for(var i=0;i<this.selectarr.length;i++)
if(pattern1.test(this.selectarr.text))
document.forms.options = this.selectarr;
document.forms.options.length = j;
if(j==1){
document.forms.options.selected = true;
//document.forms.value = document.forms.options.text;
   }
}
function setup() {
obj1 = new selobj('menuform','itemlist','entry');

obj1.bldinitial();
}
//end -->
</script>


第二步:把如下代码加入到<body>区域中

<center>
<form name="menuform" onsubmit="javascript:window.location = document.menuform.itemlist.options.value;return false;">
    <font face="arial, helvetica" size="-1">键入a-d看看效果.</font> <br>
    <br>
<input type="text" name="entry" size="30" onkeyup="javascript:obj1.bldupdate();">
<br>
<select name="itemlist" size=5>
<option value="page.html">all
<option value="page.html">all catalog
<option value="page.html">all clusters
<option value="page.html">all clusters hash expressions
<option value="page.html">all col comments
<option value="page.html">all col privs
<option value="page.html">all col privs made
<option value="page.html">all col privs sent
<option value="page.html">all constraints
<option value="page.html">all cons columns
<option value="page.html">all db links
<option value="page.html">all def audit
<option value="page.html">all dependencies
<option value="page.html">all errors
<option value="page.html">all histograms
<option value="page.html">all indexes
<option value="page.html">all ind columns
<option value="page.html">all jobs
<option value="page.html">all objects
<option value="page.html">all refresh
<option value="page.html">all refresh now
<option value="page.html">all users
<option value="page.html">all views
<option value="page.html">audit actions
<option value="page.html">books
<option value="page.html">clients
<option value="page.html">closed
<option value="page.html">column privileges
<option value="page.html">dba analyze cost
<option value="page.html">dba from clients
<option value="page.html">dba from neighbors
<option value="page.html">dba profiles
<option value="page.html">dba refresh all
<option value="page.html">dba refresh page

<option value="page.html">dba report
<option value="page.html">dba rgroup
<option value="page.html">dba role
<option value="page.html">dba role summary
<option value="page.html">dba rollback segs
</select>
</form>
</center>


第三步:把“onload="javascript:setup()"”加在<body>标记里
例如:<body onload="javascript:setup()">
      










--------------------------------------

拥有三人行论坛管理系列软件,一个人就可以管理一个论坛的更新维护。还能使您的论坛有千人在线的真实火暴效果,让您不在为论坛因没有人气而留不住会员而烦恼,使您的论坛早日成为一流的论坛。详情请登陆网站:http://www.cnsrx.cn 三人行论坛管理软件,站长必备的专业好工具。(您使用的是免费版本,购买收费版本后,将不带广告。业务QQ:247216 44985227)
页: [1]
查看完整版本: ***综合类***可以快捷选择的下拉菜单