Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7706
  • 博文数量: 14
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 150
  • 用 户 组: 普通用户
  • 注册时间: 2011-02-25 22:56
文章分类

全部博文(14)

分类: jQuery

2014-08-24 21:24:31




有朋友说联通网站的登录是这样的,不过我这里Firefox、IE都无法看到效果。看不到也能模仿。


点击(此处)折叠或打开

  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>无标题文档</title>
  6. <!-- 新 Bootstrap 核心 CSS 文件 -->
  7. <link rel="stylesheet" href="">
  8. <!-- 可选的Bootstrap主题文件(一般不用引入) -->
  9. <link rel="stylesheet" href="">
  10. <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
  11. <script src=""></script>
  12. <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
  13. <script src=""></script>
  14. </head>
  15. <body>
  16. <form class="form-horizontal" role="form">
  17.   <div class="form-group has-feedback">
  18.     <label class="control-label col-sm-2" for="inputSuccess3">Input with success</label>
  19.     <div class="col-sm-4">
  20.      <input type="password" class="form-control" name="password">
  21.      <span class="glyphicon glyphicon-eye-open form-control-feedback btn_1"></span>
  22.     </div>
  23.   </div>
  24. </form>    

  25. <script>
  26. $(document).ready(function(){    
  27.     $(document).on('mouseenter','.btn_1',function(){
  28.         $('input[name="password"]').attr('type','text');
  29.     });    
  30.     $(document).on('mouseleave','.btn_1',function(){
  31.         $('input[name="password"]').attr('type','password');
  32.     });    
  33. });
  34. </script>
  35. </body>
  36. </html>


阅读(277) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~