Saturday, January 15, 2011

Login Screen Shaking

Shaking the Login Screen.  when u can refresh the page and submit the page....

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
          addLoadEvent = function(func){
            if (typeof jQuery!="undefined")
                jQuery(document).ready(func);
           
            else if ( typeof wpOnload!='function'){
                wpOnload=func;
            } else {
                var oldonload=wpOnload;
                wpOnload=function(){
                    oldonload();
                    func();
                }
            }
        };
       
        function s(id,pos){
            g(id).left = pos+'px';
        }
        function g(id){
            return document.getElementById(id).style;
        }
        function shake(id,a,d) {
            c=a.shift();
            s(id,c);
            if(a.length>0){
                setTimeout(function(){
                    shake(id,a,d);
                },d);
            } else {
                try {
                    g(id).position='static';
                    wp_attempt_focus();
                }
                catch(e){}
            }
        }
       
        addLoadEvent(function(){
            var p = new Array(10, 10, 10, 0, -10, -10, -10, 0);
            p = p.concat(p.concat(p));
            var i = document.forms[0].id;g(i).position='relative';
            shake(i, p, 20);
        });
  </script>


</head>
<body onload="document.getElementById('username').focus();">
<table width="90%" cellpadding="0" cellspacing="0" border="0" align="center">
   <tr>
      <td valign="top">
         <form method="post" action="" name="frmLogin" id="frmLogin">
                 <table width="50%" cellpadding="2" cellspacing="2" border="1" align="center">
                         <tr><td height="10px"></td></tr>
                          <tr>
                        <td width="40%"> USERNAME:</td>
                         <td width="60%">
                                 <input type="text" name="username" id="username" autocomplete="off" />
                      </td>
                      </tr>
                       <tr>
                       <td>PASSWORD: </td>
                      <td>
                       <input type="password" name="password" id="password" autocomplete="off" />
                   </td>
               </tr>             </table>
      </form>
  </td>
</tr>
</table>
</body>
</html>
<script type="text/javascript">
    function wp_attempt_focus(){
        setTimeout( function() {
            try {
                d = document.getElementById('username');
                d.value = '';
                d.focus();
            } catch(e){}
        }, 200);
    }
     wp_attempt_focus();
    if(typeof wpOnload == 'function')wpOnload();
  </script>

No comments: