爱易网
IT新闻
IT新闻
爱易资讯
网站搭建
云虚拟主机教程
云服务器教程
Apache教程
IIS教程
Nginx教程
网站策划
站长文章
推广教程
淘宝客教程
网页设计
HTML教程
XHTML教程
CSS教程
HTML5教程
CSS3教程
JavaSript基础
JQuery教程
Node.js教程
前端技术
Ajax教程
Js特效
Xml教程
平面设计
页面UI设计
photoshop教程
程序开发
AI人工智能
Asp教程
Php教程
Asp.Net教程
Net Core教程
C#教程
Java教程
Jsp教程
开发技术
微信小程序教程
Uniapp开发教程
微信公众号开发
Andriod教程
IOS教程
DOS教程
Python教程
Docker教程
Windows Container教程
数据库
MSSQL教程
MySQL教程
Redis教程
Access教程
Oracle教程
数据库教程
操作系统
Linux教程
Windows教程
MAC教程
Cisco教程
交换机教程
防火墙教程
搜索
爱易网页
JS特效
模仿IE自动完成功能,读取输入框存取记录
模仿IE自动完成功能,读取输入框存取记录
日期:2014-05-18 浏览次数:20223 次
欢迎光临爱易网网页脚本特效中心,点击运行按钮演示特效:
以下是程序代码
<HTML> <HEAD> <title>网页特效代码|JsCode.CN|---模仿IE自动完成功能,读取输入框存取记录</title> <style> body,div { font-family:verdana; line-height:100%; font-size:9pt; } input { width:300px; } h1 { text-align:center; font-size:2.2em; } #divf { margin:10px; font-size:0.8em; text-align:center; } #divc { border:1px solid #333333; } .des { width:500px; background-color:lightyellow; border:1px solid #333; padding:20px; margin-top:20px; } .mouseover { color:#ffffff; background-color:highlight; width:100%; cursor:default; } .mouseout { color:#000000; width:100%; background-color:#ffffff; cursor:default; } </style> <SCRIPT LANGUAGE="JavaScript"> <!-- // script by blueDestiny // email : blueDestiny [at] 126 . com // Object: jsAuto // browser: ie, mf. // example: // step1 : // create autocomplete container, return object and bind event to the object, and ///create a new jsAuto instance: // <div id="divautocomplete"></div> // var autocomplete = new jsAuto("autocomplete","divautocomplete") // handle event: // autocomplete.handleEvent(value, returnObjectID) // <input id="rautocomplete" onkeyup="autocomplete.handleEvent(this.value,"ratocomplete",event)> // step2 : // add autocompete item: // autocomplete.item(string) // string must be a string var, you can split the string by "," // autocomplete.item("blueDestiny,never-online,csdn,blueidea") // http://www.never-online.com function jsAuto(instanceName,objID) { this._msg = []; this._x = null; this._o = document.getElementById( objID ); if (!this._o) return; this._f = null; this._i = instanceName; this._r = null; this._c = 0; this._s = false; this._v = null; this._o.style.visibility = "hidden"; this._o.style.position = "absolute"; this._o.style.zIndex = "9999"; this._o.style.overflow = "auto"; this._o.style.height = "50"; return this; }; jsAuto.prototype.directionKey=function() { with (this) { var e = _e.keyCode ? _e.keyCode : _e.which; var l = _o.childNodes.length; (_c>l-1 || _c<0) ? _s=false : ""; if( e==40 && _s ) { _o.childNodes[_c].className="mouseout"; (_c >= l-1) ? _c=0 : _c ++; _o.childNodes[_c].className="mouseover"; } if( e==38 && _s ) { _o.childNodes[_c].className="mouseout"; _c--<=0 ? _c = _o.childNodes.length-1 : ""; _o.childNodes[_c].className="mouseover"; } if( e==13 ) { if(_o.childNodes[_c] && _o.style.visibility=="visible") { _r.value = _x[_c]; _o.style.visibility = "hidden"; } } if( !_s ) { _c = 0; _o.childNodes[_c].className="mouseover"; _s = true; } }}; // mouseEvent. jsAuto.prototype.domouseover=function(obj) { with (this) { _o.childNodes[_c].className = "mouseout"; _c = 0; obj.tagName=="DIV" ? obj.className="mouseover" : obj.parentElement.className="mouseover"; }}; jsAuto.prototype.domouseout=function(obj) { obj.tagName=="DIV" ? obj.className="mouseout" : obj.parentElement.className="mouseout"; }; jsAuto.prototype.doclick=function(msg) { with (this) { if(_r) { _r.value = msg; _o.style.visibility = "hidden"; } else { alert("javascript autocomplete ERROR :\n\n can not get return object."); return; } }}; // object method; jsAuto.prototype.item=function(msg) { if( msg.indexOf(",")>0 ) { var arrMsg=msg.split(","); for(var i=0; i<arrMsg.length; i++) { arrMsg[i] ? this._msg.push(arrMsg[i]) : ""; } } else { this._msg.push(msg); } this._msg.sort(); }; jsAuto.prototype.append=function(msg) { with (this) { _i ? "" : _i = eval(_i); _x.push(msg); var div = document.createElement("DIV"); //bind event to object. div.onmouseover = function(){_i.domouseover(this)}; div.onmouseout = function(){_i.domouseout(this)}; div.onclick
上一篇:狡猾的按钮特效
下一篇:用鼠标和按钮控制网页内容的上下滚动
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
微信收费形式三选一 腾讯或变身运营商
永不磨灭的九大尖端编程语言
总部大楼已换微软Logo:回忆诺基亚的兴衰史
史玉柱此刻离任:营销巨匠为新游戏炒作?
用友软件股价逆势下跌 再融资方案现曙光
三星起诉LG在冰箱广告中玷污其企业笼统
支付宝全面封杀比特币:充值码淘宝店或遭封禁
一个非脑残米粉的思考:小米“成功之道”如何炼成
让一让,小米4来了,碰见米粉请务必绕道走!
推荐阅读
更多>
京东物流"最后一公里":颠覆阿里或者被阿里干掉
唯品会荣登“最贵中概股”的欢喜与哀愁
首批四款“官方”打车软件发布:均为安卓版本
靠谱分析:6月发生的WWDC和谷歌I/O大会,将会出现哪些新产品?
传苹果中移动达成协议:新iPhone兼容TD制式
HDS发布《2013中国CIO洞察白皮书》
惠普董事长莱恩辞职 为巨额财务减记埋单
小微型IDC云化趋势加剧 云计算未来或现终极模式
让一让,小米4来了,碰见米粉请务必绕道走!
360涉足搜索范围 百度市场份额面临应战
“论文查重”网店一月收入竟过百万
中移动将推出多项4G资费新政
都是300元内 乐视盒子与小米盒子对比体验
欧洲6万人起诉Facebook隐私侵权
2018双11阿里云老用户怎么参加拼团活动 老用户拼团方法
百视通:Xbox One汉化获批 游戏迷欢呼吧
完美入股盛大:一桩各怀心事的交易
网络视频的几大趋势将成视频玩家躲不开的发力点
酷派首抓4G时机大丰收,未来份额必降无疑
支付宝曝平安破绽:转账信息被谷歌抓取