登陆框 提醒文字/功能
来源:互联网 发布:java算法笔试题 编辑:程序博客网 时间:2024/05/16 09:00
由于项目需要在登陆框上面添加提醒文字的功能,功能类似于新浪微博的。折腾了一天,总算是把他给弄出来了。下面贴出代码来:
欢迎访问我的博客
<html> <head> <title>登陆框 提醒功能</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <style> /*下拉框*/ .son_ul{background:#fff;width:200px;border:1px solid #ccc;padding:0 2px;position:absolute;left:70px;top:30px;color:#333;text-indent:5px; overflow:hidden;zoom:1;} .son_ul ul{padding:0;} .son_ul ul li{height:20px;line-height:20px;cursor:pointer;height:20px;line-height:20px; overflow:hidden;} .son_ul .hover{background:#efefef;} .server_list h2 em{margin-top:0;} </style> <script type="text/javascript" src="http://f.game.tom.com/xbyxpt/js/jquery-1.4.2.min.js"></script> <script type="text/javascript"> //定义类 var lLayer = { currentIndex:-1 }; //生成页面的HTML代码 lLayer.geneList = function (prefix) { if (prefix == '' || prefix =='undefined') { prefix = ''; } var mailList = [ {'name':'tom', 'address': '@tom.com', 'index':'0'}, {'name':'163', 'address': '@163.com', 'index':'1' }, {'name':'sina', 'address': '@sina.com', 'index':'2'}, {'name':'qq', 'address': '@qq.com', 'index':'3'}, {'name':'126', 'address': '@126.com', 'index':'4'}, {'name':'hotmail', 'address': '@hotmail.com', 'index':'5'}, {'name':'gmail', 'address': '@gmail.com', 'index':'6'}, {'name':'suho', 'address': '@suho.com', 'index':'7'}, {'name':'yahoo', 'address': '@yahoo.com', 'index':'8'}, {'name':'139', 'address': '@139.com', 'index':'9'} ]; var html = ''; for (var i = 0; i < mailList.length; i++) { if (i == 0) { html += '<li id="liid_'+mailList[i].index+'" syle="bgcolor:#999999">'+prefix+mailList[i].address+'</li>'; } else { html += '<li id="liid_'+mailList[i].index+'">'+prefix+mailList[i].address+'</li>'; } } $('#ullists').html(html); } //输入字符信息,自动补全 lLayer.setItem = function (value, event) { if (value == '' || value =='undefined') { lLayer.layerHide('loginLayers'); } lLayer.geneList(value); lLayer.layerShow('loginLayers'); lLayer.moveItems(event.keyCode); if (event.keyCode == 13) { lLayer.selectItems(); } } //移动方向键 lLayer.moveItems = function (keyCode) { var liListNum = document.getElementById("ullists").getElementsByTagName("li").length; liListNum -= 1; if (keyCode == 38) { if (lLayer.currentIndex == 0) { lLayer.currentIndex = liListNum; } else { lLayer.currentIndex -= 1; } document.getElementById('liid_'+lLayer.currentIndex).style.backgroundColor = "#999999"; } else if (keyCode == 40) { if (lLayer.currentIndex == liListNum) { lLayer.currentIndex = 0; } else { lLayer.currentIndex += 1; } document.getElementById('liid_'+lLayer.currentIndex).style.backgroundColor = "#999999"; } } //选择内容 lLayer.selectItems = function () { if (lLayer.currentIndex == -1) { lLayer.currentIndex = 0; } var passport = $('#liid_'+lLayer.currentIndex).text(); document.getElementById('tomid').value = passport; lLayer.layerHide('loginLayers'); document.getElementById('tompwd').focus(); } //浮层显示 lLayer.layerShow = function (id) { return document.getElementById(id).style.display = 'block'; } //浮层隐藏 lLayer.layerHide = function (id) { return document.getElementById(id).style.display = 'none'; } </script> </head> <body> 用户名:<input type="text" name="tomid" id="tomid" class="inp" autocomplete="off" tabindex="1" onKeyUp="lLayer.setItem(this.value, event)"/> <div class="son_ul" id="loginLayers" style="display:none;"> <strong>请选择账号类型</strong> <ul id="ullists"> </ul> </div> <br /> 密 码:<input type="password" id="tompwd" name="tompwd"/> </body></html>
- 登陆框 提醒文字/功能
- 文本框显示提醒功能
- CSDN的提醒功能
- 离开页面提醒功能
- 生日提醒功能
- 关于短信提醒功能
- 自动提醒功能
- 订单提醒功能
- 消息到达提醒功能
- 桌面提醒功能
- Chrome桌面提醒功能
- 生日提醒功能(oracle)
- 邮件提醒功能
- Chrome桌面提醒功能
- CSDN博客提醒功能
- MT4之提醒功能
- 有定时提醒功能的气泡消息框
- HTML5开发 桌面提醒功能
- 在iPhone应用里直接打开app store 评论页面的方法
- 磁盘阵列(raid5)搭建
- 10905 - Children's Game
- SQL TOP 子句
- 公司绝不会告诉你的20大秘密 毕业生值得一看很受用
- 登陆框 提醒文字/功能
- 逆向分析 C++继承内存分布(带虚函数) 及动态绑定实现
- 论ACM与泡妞
- hdu1114!完全背包!(一维数组)
- NSURLConnection同步,异步与SSL
- Linux下密码过期时间设置 (chage 的设置)
- RMQ问题的线段树解法
- 启点在何处?
- UITextField+总结