参照:Twitter like Login with Jquery and CSS
Twitterのドロップダウン形式のログインフォームをjQueryを使用して実装する方法が紹介されています。
<!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" xml:lang="ja" lang="ja"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Language" content="ja" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta http-equiv="imagetoolbar" content="no" /> <title>設置サンプル</title> <link rel="stylesheet" href="/content/lib/global.css" type="text/css" /> <!-- JS --> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript"> $(function() { $(".sign_in").click(function(){ $("#sign_box").show(); return false; }); $("#btn_close").click(function(){ $("#sign_box").hide(); return false; }); }); </script> <!-- CSS --> <style type="text/css"> body { background:#ddeef6; } #warp { position:relative; } #sign_box { width:170px; background-color:#fff; border:solid 1px #5ea0c1; padding:8px; position:absolute; display:none; -moz-border-radius-topright:6px; -moz-border-radius-bottomleft:6px; -moz-border-radius-bottomright:6px; -webkit-border-top-right-radius:6px; -webkit-border-bottom-left-radius:6px; -webkit-border-bottom-right-radius:6px; } #btn_close { position:absolute; top:0; right:0; font-size:13px; width:13px; height:13px; display:block; margin:5px; } .sign_in { background-color:#fff; border:solid 1px #5ea0c1; padding:6px; } </style> <link rel="stylesheet" type="text/css" href="/common/css/example.css"></head> <body id='example3' class='example'><div class="ads" style="margin:32px auto;text-align:center;"></div><h1 class='h'><a href='/'>PHP & JavaScript Room</a> :: 設置サンプル</h1> <h3 class='h'>実行結果</h3> <div id="wrap"> <h1>設置サンプル</h1> <div id="container"> <p>参照:<a href='http://www.9lessons.info/2009/12/twitter-like-login-with-jquery-and-css.html'>Twitter like Login with Jquery and CSS</a></p> <p> Twitterのドロップダウン形式のログインフォームをjQueryを使用して実装する方法が紹介されています。 </p> </div> <!-- CODE --> <div><a href="#" class="sign_in">Sign In</a></div> <div id="sign_box"> <form method="post" action="http://phpjavascriptroom.com/example6.php?f=include/ajax/jquery_plugin_twitterlikes/thankyou.inc"> <label>UserName <input type="text" name="usr"/></label> <label>Password <input type='password' name="pwd"/></label> <p style="margin:5px 0 0 0;"> <input type="submit" value=" Sing In "/> </p> <a href="#" id="btn_close">×</a> </form> </div> <!-- CODE / --> </div> </body> </html>