<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> xSelectList Demo </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">

</HEAD>

<BODY>
下拉列表控件演示
<div id="demolist"></div>

<div>
<HR>
基于select生成
<BR>
<select id="vlist">
<option value="1">Item1</option>
<option value="2">Item2</option>
<option value="3" selected>Item3</option>
<option value="11">Item11</option>
<option value="22">Item22</option>
<option value="33">Item33</option>
<option value="4">Item4</option>
<option value="44">Item44</option>
<option value="4">Item4</option>
<option value="44">Item44</option>
<option value="4">Item4</option>
<option value="44">Item44aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</option>
<option value="a">a</option>
<option value="aa">aa</option>
<option value="ap">ap</option>
<option value="app">app</option>
</select>
</div>
<HR>
基于input生成
<div>
<input id="xlist" value="">
</div>
<div>

<HR>
基于div生成
<BR>
<div id="zlist"></div>

</div>

&nbsp;<BR>
<span id="ylist"></span>
</BODY>
</HTML>

<script language="javascript">
<!--//输入脚本内容
function xSelectList(c){

var me=this;this.id=c.id;this.dom=c.dom;this.usetype=c.usetype;this.ifmult=c.ifmult;this.defvalue=c.value;this.onchange=c.onchange;this.onselected=c.onselected;this.ondropdown=c.ondropdown;this.caption=c.caption;this.size=c.size;this.ui={};this.ui.box=null;this.ui.btn=null;this.info={};this.info.type=false;this.info.flag=false;this.info.tagname="";this.info.readered=false;this.showdiv=null;this.showtab=null;this.data=[];this.result=[];this.keyword="";this.isIE=navigator.userAgent.search('MSIE')>0;
this.config={};this.config.css={};this.config.css.box="BORDER-RIGHT: Silver 1px solid;PADDING-RIGHT: 1px;BORDER-TOP: Silver 1px solid;PADDING-LEFT: 1px;FONT-SIZE: 12px;PADDING-BOTTOM: 1px;BORDER-LEFT: Silver 1px solid;COLOR: #000000;PADDING-TOP: 1px;BORDER-BOTTOM: Silver 1px solid;FONT-FAMILY:'宋体';HEIGHT: 18px;BACKGROUND-COLOR: #fefefe;";this.config.css.textarea="BORDER-RIGHT: Silver 1px solid;PADDING-RIGHT: 1px;BORDER-TOP: Silver 1px solid;PADDING-LEFT: 1px;FONT-SIZE: 12px;PADDING-BOTTOM: 1px;BORDER-LEFT: Silver 1px solid;COLOR: #000000;PADDING-TOP: 1px;BORDER-BOTTOM: Silver 1px solid;width:100%;FONT-FAMILY:'宋体';BACKGROUND-COLOR: #fefefe;SCROLLBAR-SHADOW-COLOR: #f9f8f5;SCROLLBAR-3DLIGHT-COLOR: #e5e4e0;SCROLLBAR-ARROW-COLOR: #88888;SCROLLBAR-TRACK-COLOR: #f9f8f5;SCROLLBAR-DARKSHADOW-COLOR: #e5e4e0";this.config.css.btn="BORDER-RIGHT: gray 1px solid; BORDER-TOP: Silver 1px solid; FONT-SIZE: 12px; BORDER-LEFT: whitesmoke 1px solid; CURSOR: pointer; BORDER-BOTTOM: gray 1px solid; FONT-FAMILY: marlett;height:18px;";this.config.css.btn1="BORDER-RIGHT: gray 1px solid;width:18px; BORDER-TOP: Silver 1px solid; FONT-SIZE: 12px; BORDER-LEFT: whitesmoke 1px solid; CURSOR: pointer; BORDER-BOTTOM: gray 1px solid; height:18px;";this.config.css.listdiv="BORDER-LEFT: Silver 1px solid;visibility:visible;BORDER-RIGHT:Silver 1px solid;BORDER-BOTTOM: Silver 1px solid;position:absolute;overflow-y:hidden;SCROLLBAR-FACE-COLOR: #D2D2D2;SCROLLBAR-HIGHLIGHT-COLOR: #ffffff;BACKGROUND-COLOR: #fefefe;SCROLLBAR-SHADOW-COLOR: #f9f8f5;SCROLLBAR-3DLIGHT-COLOR: #e5e4e0;SCROLLBAR-ARROW-COLOR: #88888;SCROLLBAR-TRACK-COLOR: #f9f8f5;SCROLLBAR-DARKSHADOW-COLOR: #e5e4e0;";this.config.css.tableall="FONT-FAMILY:'宋体';FONT-SIZE: 12px;CURSOR:pointer;cellpadding:0;cellspacing:0;BORDER-BOTTOM: Silver 0px solid;width:100%;";this.config.css.span="FONT-SIZE: 12px;";
if(c.dom==null||c.dom==""||typeof (c.dom)=="undefined"){this.dom=document.body;}else {if(typeof (c.dom)=="string"){var tmpdom=document.getElementById(c.dom);if(!tmpdom){tmpdom=document.getElementsByName(c.dom);};if(tmpdom){this.dom=tmpdom;}else {this.dom=document.body;}}else {this.dom=c.dom;}};if(c.id==""||c.id==null||typeof (c.id)=="undefined"){this.id="xselectlist"};if(document.getElementById(this.id)||document.getElementsByName(this.id)){if(document.getElementById(this.id)){this.info.type=true;document.getElementById(this.id).name=this.id;}else {this.info.type=true;document.getElementsByName(this.id).id=this.id;}};if(c.onchange==""||c.onchange==null||typeof (c.onchange)=="undefined"){this.onchange=function (){};}else {if(typeof (c.onchange)=="function"){this.onchange=c.onchange;}else {this.onchange=function (){};}};if(c.onselected==""||c.onselected==null||typeof (c.onselected)=="undefined"){this.onselected=function (){};}else {if(typeof (c.onselected)=="function"){this.onselected=c.onselected;}else {this.onselected=function (){};}};if(c.ondropdown==""||c.ondropdown==null||typeof (c.ondropdown)=="undefined"){this.ondropdown=function (){};}else {if(typeof (c.ondropdown)=="function"){this.ondropdown=c.ondropdown;}else {this.ondropdown=function (){};}};if(this.info.type){var tmpnode=document.getElementById(this.id);if(tmpnode){var nodeType=tmpnode.tagName.toLowerCase();this.info.tagname=nodeType;}};if(c.size==""||c.size==null||typeof (c.size)=="undefined"){this.size=20;}else {if(typeof (c.size)=="number"){this.size=c.size;}else {this.size=20;}};if(c.caption==""||c.caption==null||typeof (c.caption)=="undefined"){this.caption="";}else {if(typeof (c.caption)=="string"){this.caption=c.caption;}else {this.caption="";}};if(typeof (c.defvalue)=="undefined"){this.defvalue="";};if(c.usetype==""||typeof (c.usetype)=="undefined"||c.usetype==null){this.usetype="list";}else {this.usetype=c.usetype.toLowerCase();};if(this.usetype=="listbox"){if(c.ifmult==""||c.ifmult==null||typeof (c.ifmult)=="undefined"){this.ifmult=false;}else {if(typeof (c.ifmult)=="boolean"){this.ifmult=c.ifmult;}else {this.ifmult=false;}}}else {this.ifmult=false;};
this.reader=function (){if(this.info.readered){return ;};this.initui();this.initdefvalue();this.info.readered=true;};
this.initui=function (){var nodeType=this.info.tagname;var d=[];if(nodeType=="select"){var nodes=document.getElementById(this.id).options;for(var i=0;i<nodes.length;i++){var dd={};dd.value=nodes[i].value;dd.text=nodes[i].text;dd.idx=i;if(nodes[i].selected){dd.select=true;}else {dd.select=false;};d.push(dd);};this.data=d;this.dom=document.getElementById(this.id).parentNode;this.dom.removeChild(document.getElementById(this.id));var oc=document.createElement("span");oc.style.cssText=this.config.css.span;oc.innerHTML=this.caption;var oo=document.createElement("input");oo.id=this.id;oo.name=this.id;oo.type="text";oo.setAttribute("ivalue","");oo.setAttribute("typeid","");oo.setAttribute("idx",-1);oo.value="";oo.style.cssText=this.config.css.box;oo.size=this.size;this.ui.box=oo;var ob=document.createElement("input");ob.id=this.id+"_btn";ob.name=this.id+"_btn";ob.type="button";ob.style.cssText=this.isIE?this.config.css.btn:this.config.css.btn1;ob.value=this.isIE?"6":"▼";this.ui.btn=ob;if(this.usetype=="filterlist"){this.ui.box.readOnly=false;this.ui.box.onfocus=this.onfocus;this.ui.box.onblur=this.onblur;this.ui.box.onkeyup=this.onkeyup;this.ui.box.onkeydown=this.onkeydown;}else {this.ui.box.readOnly=true;};this.ui.btn.onclick=this.dropdown;this.dom.appendChild(oc);this.dom.appendChild(this.ui.box);this.dom.appendChild(this.ui.btn);}else if(nodeType=="input"){this.dom=document.getElementById(this.id).parentNode;this.dom.removeChild(document.getElementById(this.id));var oc=document.createElement("span");oc.style.cssText=this.config.css.span;oc.innerHTML=this.caption;var oo=document.createElement("input");oo.id=this.id;oo.name=this.id;oo.type="text";oo.setAttribute("ivalue","");oo.setAttribute("typeid","");oo.setAttribute("idx",-1);oo.value="";oo.style.cssText=this.config.css.box;oo.size=this.size;this.ui.box=oo;var ob=document.createElement("input");ob.id=this.id+"_btn";ob.name=this.id+"_btn";ob.type="button";ob.style.cssText=this.isIE?this.config.css.btn:this.config.css.btn1;ob.value=this.isIE?"6":"▼";this.ui.btn=ob;if(this.usetype=="filterlist"){this.ui.box.readOnly=false;this.ui.box.onfocus=this.onfocus;this.ui.box.onblur=this.onblur;this.ui.box.onkeyup=this.onkeyup;this.ui.box.onkeydown=this.onkeydown;}else {this.ui.box.readOnly=true;};this.ui.btn.onclick=this.dropdown;this.dom.appendChild(oc);this.dom.appendChild(this.ui.box);this.dom.appendChild(this.ui.btn);}else {var oc=document.createElement("span");oc.style.cssText=this.config.css.span;oc.innerHTML=this.caption;var oo=document.createElement("input");oo.id=this.id;oo.name=this.id;oo.type="text";oo.setAttribute("ivalue","");oo.setAttribute("typeid","");oo.setAttribute("idx",-1);oo.value="";oo.style.cssText=this.config.css.box;oo.size=this.size;this.ui.box=oo;var ob=document.createElement("input");ob.id=this.id+"_btn";ob.name=this.id+"_btn";ob.type="button";ob.style.cssText=this.isIE?this.config.css.btn:this.config.css.btn1;ob.value=this.isIE?"6":"▼";this.ui.btn=ob;if(this.usetype=="filterlist"){this.ui.box.readOnly=false;this.ui.box.onfocus=this.onfocus;this.ui.box.onblur=this.onblur;this.ui.box.onkeyup=this.onkeyup;this.ui.box.onkeydown=this.onkeydown;}else {this.ui.box.readOnly=true;};this.ui.btn.onclick=this.dropdown;this.dom.appendChild(oc);this.dom.appendChild(this.ui.box);this.dom.appendChild(this.ui.btn);}};
this.onfocus=function (){this.setAttribute("oldValue",this.value);if(me.showdiv){me.offdisplay(false);}};
this.onblur=function (){};
this.onkeyup=function (){if(this.getAttribute("oldValue")==this.value){return false;}else {me.keyword=this.value;if(me.keyword!=""&&me.keyword!=null){me.filterdata();me.showlist();}else {me.offdisplay(false);};this.setAttribute("oldValue",this.value);}};
this.onkeydown=function (){var evt=arguments[0];evt=(evt)?evt:((window.event)?window.event:"");var key=evt.keyCode?evt.keyCode:(evt.which?evt.which:evt.charCode);if(key==40){if(me.showdiv){if(me.showtab){if(parseInt(me.showtab.getAttribute("rowcount"))>=0){var orow=document.getElementById(me.id+"_tab_rows_0");if(orow){orow.onmouseover();if(me.isIE){me.showtab.setActive();}else {}}}}}};if(key==13){me.offdisplay(false);}};
this.dropdown=function (){var div=me.showdiv;if(div){if(div.style.display=='none'){me.keyword="";me.result=me.data;me.showlist();}else {me.offdisplay(false);}}else {me.keyword="";me.result=me.data;me.showlist();}};
this.offdisplay=function (b){if(me.showdiv){if(b){me.showdiv.style.display='';me.ondropdown.call(me);}else {me.showdiv.style.display='none';}}};
this.filterdata=function (){if(this.usetype!="filterlist"){return ;};if(this.keyword==""||this.keyword==null){return ;};var ilist=this.data;var d=[];var f=this.keyword;for(var i=0;i<ilist.length;i++){if(ilist[i].text.toLowerCase().indexOf(f.toLowerCase())>=0){d.push(ilist[i]);}};this.result=d;};
this.showlist=function (){var div;var ps;var mx=this.result.length+2;if(mx>10){mx=10;};ps=this.getoffset(this.ui.box,null);if(this.showdiv){div=this.showdiv;div.style.width=ps.z+17;div.style.left=ps.x;div.style.height=ps.h*mx;div.style.top=ps.y+20;}else {div=document.createElement("div");div.id=this.id+"_listdiv";div.style.cssText=this.config.css.listdiv;div.style.width=ps.z+17;div.style.height=ps.h*mx;div.style.top=ps.y+20;div.style.left=ps.x;document.body.appendChild(div);};div.style.overflowY="auto";div.style.overflowX="hidden";div.innerHTML="";this.offdisplay(true);var tab=div.appendChild(document.createElement("table"));tab.style.cssText=this.config.css.tableall;tab.id=me.id+"_tab";tab.setAttribute("rowcount",this.result.length);var keydown=function (){var evt=arguments[0];evt=(evt)?evt:((window.event)?window.event:"");var key=evt.keyCode?evt.keyCode:(evt.which?evt.which:evt.charCode);var rowcount=parseInt(this.getAttribute("rowcount"));var currow=me.overrow;var curobj=me.overobj;if(key==40){if(currow<rowcount){var orow=document.getElementById(this.id+"_rows_"+(currow+1));if(orow){if(curobj){curobj.onmouseout();};orow.onmouseover();}}};if(key==38){if(currow==0||currow==-1){me.ui.box.focus();me.offdisplay(false);}else {var orow=document.getElementById(this.id+"_rows_"+(currow-1));if(orow){if(curobj){curobj.onmouseout();};orow.onmouseover();}}};if(key==13){if(curobj){var oldidx=me.ui.box.getAttribute("idx");me.ui.box.value=curobj.getAttribute("text");me.ui.box.setAttribute("ivalue",curobj.getAttribute("value"));me.ui.box.setAttribute("idx",curobj.getAttribute("idx"));me.ui.box.setAttribute("typeid",curobj.getAttribute("value"));me.initselected(me.ui.box.getAttribute("idx"));if(oldidx!=me.ui.box.getAttribute("idx")){me.onchange.call(me);};me.onselected.call(me);me.ui.box.focus();me.offdisplay(false);}};if(key==27){me.ui.focus();me.offdisplay(false);}};if(this.isIE){tab.onkeydown=keydown;}else {tab.addEventListener("keydown",keydown,false);};for(var i=0;i<this.result.length;i++){var row=tab.insertRow(-1);row.height="20px";row.style.backgroundColor="#f0f0f0";var cell=document.createElement("td");cell.noWrap=true;cell.setAttribute("value",this.result[i].value);cell.setAttribute("text",this.result[i].text);cell.setAttribute("idx",this.result[i].idx);cell.setAttribute("rows",i);cell.id=me.id+"_tab_rows_"+i;cell.innerHTML=this.result[i].text;cell.title=this.result[i].text;cell.innerHTML="<span title='"+this.result[i].text+"' style='text-overflow:clip;overflow:hidden;width:"+((ps.z-6))+";'>"+this.result[i].text+"</span>";cell.setAttribute("evnbgcolor","#F0F0F0");if(this.usetype=="filterlist"){if(this.result[i].select){cell.style.backgroundColor="#FFFFCC";cell.setAttribute("oldbgcolor","#FFFFCC");}else if(this.keyword.toLowerCase()==this.result[i].text.toLowerCase()){cell.style.backgroundColor="#FFFF99";cell.setAttribute("oldbgcolor","#FFFF99");}else {cell.style.backgroundColor="#FFFFFF";cell.setAttribute("oldbgcolor","#FFFFFF");}}else {if(this.result[i].select){cell.style.backgroundColor="#FFFFCC";cell.setAttribute("oldbgcolor","#FFFFCC");}else {cell.style.backgroundColor="#FFFFFF";cell.setAttribute("oldbgcolor","#FFFFFF");}};cell.style.overflowX="hidden";var click=function (){var oldidx=me.ui.box.getAttribute("idx");me.ui.box.value=this.getAttribute("text");me.ui.box.setAttribute("ivalue",this.getAttribute("value"));me.ui.box.setAttribute("idx",this.getAttribute("idx"));me.ui.box.setAttribute("typeid",this.getAttribute("value"));me.initselected(me.ui.box.getAttribute("idx"));if(oldidx!=me.ui.box.getAttribute("idx")){me.onchange.call(me);};me.onselected.call(me);me.ui.box.focus();me.offdisplay(false);};var mouseover=function (){me.overrow=this.getAttribute("rows");me.overobj=this;this.style.backgroundColor=this.getAttribute("evnbgcolor");};var mouseout=function (){this.style.backgroundColor=this.getAttribute("oldbgcolor");};if(this.isIE){cell.onmouseover=mouseover;cell.onmouseout=mouseout;cell.onclick=click;}else {cell.addEventListener("mouseover",mouseover,false);cell.addEventListener("mouseout",mouseout,false);cell.addEventListener("click",click,false);};row.appendChild(cell);};this.offdisplay(true);div.onclick=function (){me.offdisplay(false);};if(this.result.length==0){div.onmouseout=function (){me.offdisplay(false);}}else {div.onmouseout=function (){}};this.showdiv=div;this.showtab=tab;};
this.initselected=function (idx){var ilist=this.data;if(ilist.length<idx){return ;};for(var i=0;i<ilist.length;i++){ilist[i].select=false;};ilist[idx].select=true;this.data=ilist;};
this.loaddata=function (d){var ilist=[];var dd=d;var ifselect=false;for(var i=0;i<dd.length;i++){var m={};if(typeof (dd[i].text)=="undefined"){m.text="";}else {m.text=unescape(dd[i].text);};if(typeof (dd[i].value)=="undefined"){m.value="";}else {m.value=unescape(dd[i].value);};if(typeof (dd[i].select)=="undefined"){m.select=false;}else {if(typeof (dd[i].select)!="boolean"){m.select=false;}else {m.select=dd[i].select;}};if(m.select){ifselect=true;};m.idx=i;ilist.push(m);};if(!ifselect){if(ilist.length>0){ilist[0].select=true;}};this.data=ilist;this.initdefvalue();};
this.initdefvalue=function (){var ilist=this.data;var idx=-1;for(var i=0;i<ilist.length;i++){if(ilist[i].select){idx=i;break;}};if(idx!=-1){this.ui.box.value=ilist[i].text;this.ui.box.setAttribute("ivalue",ilist[i].value);this.ui.box.setAttribute("idx",ilist[i].idx);this.ui.box.setAttribute("typeid",ilist[i].value);this.onselected.call(me);}};
this.getoffset=function (obj,offsetObj){var x=obj.offsetLeft;var y=obj.offsetTop;var z=obj.offsetWidth;var h=obj.offsetHeight;var tmpObj=obj.offsetParent;var _offsetObj=(offsetObj)?offsetObj:document.body;while((tmpObj!=_offsetObj)&&tmpObj){x+=tmpObj.offsetLeft-tmpObj.scrollLeft+tmpObj.clientLeft;y+=tmpObj.offsetTop-tmpObj.scrollTop+tmpObj.clientTop;tmpObj=tmpObj.offsetParent;};var cls={};cls.x=x;cls.y=y;cls.z=z;cls.h=h;return (cls);};
}
var tmpdata = [
{text:"a",value:"0",select:false},
{text:"ap",value:"1",select:false},
{text:"app",value:"2",select:false},
{text:"appl",value:"3",select:false},
{text:"apple",value:"4",select:false},
{text:"apple iphone",value:"0",select:true}
];
var x = new xSelectList({id:"vlist",caption:"只读列表基于SELECT渲染生成"});
x.reader();
var x1 = new xSelectList({id:"xlist",caption:"只读列表基于Input.Text渲染而来"});
x1.reader();
x1.loaddata(tmpdata);
var x2 = new xSelectList({id:"zlist",caption:"可以输入模糊查询",usetype:"filterlist",onchange:function(){}});
x2.reader();
x2.loaddata(tmpdata);
//--->
</script>

jquery 模糊查询下拉框的更多相关文章

  1. jquery操作select下拉框的各种方法,获取选中项的值或文本,根据指定的值或文本选中select的option项等

    简介jquery里对select进行各种操作的方法,如联动.取值.根据值或文本来选中指定的select下拉框指定的option选项,读取select选中项的值和文本等. 这一章,站长总结一下jquer ...

  2. jQuery操作select下拉框的text值和value值的方法

    1.jquery获取当前选中select的text值 $("#select1").find("option:selected").text(); 2.jquer ...

  3. jQuery之双下拉框

    双下拉框要实现的效果,实际上就是左边下拉选择框里的内容,可以添加到右边,而右边同理.写了个简单的例子,来说明一下. 代码如下: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ...

  4. js&amp;jquery 获取select下拉框的值、文本内容、自定义属性

      js&jquery 获取select下拉框的值.文本内容.自定义属性 CreationTime--2018年7月2日09点22分 Author:Marydon html <selec ...

  5. JQuery操作select下拉框

    JQuery操作select下拉框 获取Select选择的Text和Value $("#select_id").change(function(){//code...}); //为 ...

  6. jquery Combo Select 下拉框可选可输入插件

    Combo Select 是一款友好的 jQuery 下拉框插件,在 PC 浏览器上它能模拟一个简单漂亮的下拉框,在 iPad 等移动设备上又能回退到原生样式.Combo Select 能够对选项进行 ...

  7. Jquery制作--美化下拉框

    平常我们用的原生select下拉框,大部分样式没办法修改,导致在不同的浏览器里面会跟设计图的风格大相径庭.所以为了能让它美化起来,就用JQ模拟了一个下拉框,可以随意定义样式.原生的下拉框也保留在div ...

  8. jQuery Ajax MVC 下拉框联动

    无刷新下拉框联动方法: Controllers代码 public JsonResult DH_Change(string DH_ID) { List<SelectListItem> Tea ...

  9. Jquery学习笔记:利用jquery获取select下拉框的值

    jquery不是特别熟练,每次使用不常用的就要百度,特地记录下来. 我的下拉框是: <div class="form-group"> <select class= ...

随机推荐

  1. 【krpano】汉化Web VR设置界面

    欢迎加入qq群551278936讨论krpano解密技术以及获取最新软件 krpano 1.19支持了Web VR功能,允许以VR的方式查看全景图,配合上VR设备可以实现VR效果. 在VR方式查看时, ...

  2. ubuntu下android开发环境安装

    一 安装jdk 网址:http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html 新建一个文 ...

  3. 计算机网络及TCP/IP知识点(全面,慢慢看)

    TCP/IP网络知识点总结 一.总述 1.定义:计算机网络是一些互相连接的.自治的计算机的集合.因特网是网络的网络. 2.分类: 根据作用范围分类: 广域网 WAN (Wide Area Networ ...

  4. tomcat中的线程问题2

    最近在看线程的有关知识,碰到一个小问题,目前还没有解决,现记录下来. 如果在我们自己写的servlet里有成员变量,因为多线程的访问就会出现一些线程问题.这点大家都知道,我们看下面的例子. publi ...

  5. 为什么要用日志框架 Logback 基本使用

    [日志框架]以时间为单位描述应用项目运行状态:用户下线.接口超时.数据库崩溃等等一系列事件 [日志框架能力] 1.定制输出格式 2.定制输出目标 3.携带 Context 比如 HelloWorld. ...

  6. easyui tree 默认选中第一个元素

    系统采用ajax异步调用后端接口做数据呈现,有个场景就是加载的树形菜单默认选中第一行,网上有人分享的解决方案能实现效果(http://aokunsang.iteye.com/blog/1489204) ...

  7. [洛谷 P3788] 幽幽子吃西瓜

    妖梦费了好大的劲为幽幽子准备了一个大西瓜,甚至和兔子铃仙打了一架.现在妖梦闲来无事,就蹲在一旁看幽幽子吃西瓜.西瓜可以看作一个标准的球体,瓜皮是绿色的,瓜瓤是红色的,瓜皮的厚度可视为0.妖梦恰好以正视 ...

  8. webdriver 启动chrome时加载配置

    Selenium操作浏览器是不加载任何配置的,网上找了半天,关于Firefox加载配置的多点,Chrome资料很少,下面是关于加载Chrome配置的方法:  一.加载所有Chrome配置 用Chrom ...

  9. 关于gcc编译器中函数不用进行原型声明的解释

    经过大量实验和参考网上的说法得出一个结论: gcc编译器中,函数可以不用提前进行原型声明,编译器会把函数调用同时认为是声明.需要注意的是,由于函数调用的时候并没有写明函数返回值,这是gcc把调用当成声 ...

  10. PHP文件引入

    综述和基本语法 有4个文件加载语句:include,require,include_once,require_once. require函数通常放在 PHP 程序的最前面,PHP 程序在执行前,就会先 ...