flash.html 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Flash PasswordBox Letters - jQuery EasyUI Demo</title>
  6. <link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
  7. <link rel="stylesheet" type="text/css" href="../../themes/icon.css">
  8. <link rel="stylesheet" type="text/css" href="../demo.css">
  9. <script type="text/javascript" src="../../jquery.min.js"></script>
  10. <script type="text/javascript" src="../../jquery.easyui.min.js"></script>
  11. </head>
  12. <body>
  13. <h2>Flash PasswordBox Letters</h2>
  14. <p>This example shows how to flash the entered password letter by letter.</p>
  15. <div style="margin:20px 0;"></div>
  16. <div class="easyui-panel" style="width:400px;padding:50px 60px">
  17. <div style="margin-bottom:20px">
  18. <input class="easyui-textbox" prompt="Username" iconWidth="28" style="width:100%;height:34px;padding:10px;">
  19. </div>
  20. <div style="margin-bottom:20px">
  21. <input id="pass" class="easyui-passwordbox" prompt="Password" iconWidth="28" style="width:100%;height:34px;padding:10px">
  22. </div>
  23. </div>
  24. <div id="viewer"></div>
  25. <script type="text/javascript">
  26. $('#pass').passwordbox({
  27. inputEvents: $.extend({}, $.fn.passwordbox.defaults.inputEvents, {
  28. keypress: function(e){
  29. var char = String.fromCharCode(e.which);
  30. $('#viewer').html(char).fadeIn(200, function(){
  31. $(this).fadeOut();
  32. });
  33. }
  34. })
  35. })
  36. </script>
  37. <style>
  38. #viewer{
  39. position: relative;
  40. padding: 0 60px;
  41. top: -70px;
  42. font-size: 54px;
  43. line-height: 60px;
  44. }
  45. </style>
  46. </body>
  47. </html>