login and signup 注册和登录tab页面 演示 JavaScript Code $(document).ready(function() { $(".tab").click(function() { var X=$(this).attr('id'); if(X=='signup') { $("#login").removeClass('select'); $("#signup").addClass('select'); $("#loginbox").slideUp(); $("#signupbox").slideDown(); } else { $("#signup").removeClass('select'); $("#login").addClass('select'); $("#signupbox").slideUp(); $("#loginbox").slideDown(); } }); }); XML/HTML Code Signup Login Login Form Singup Form CSS Code body { font-family:Arial, Helvetica, sans-serif; font-size:12px; background-color:#333; } #container { width:350px } #tabbox { height:40px } #panel { background-color:#aaa; height:300px; } .tab { background: #ccc; display: block; height: 40px; line-height: 40px; text-align: center; width: 80px; float: rightright; font-weight: bold; -webkit-border-top-left-radius: 4px; -webkit-border-top-rightright-radius: 4px; -moz-border-radius: 4px 4px 0px 0px; } a { color: #000; margin: 0; padding: 0; text-decoration: none; } .signup { margin-left:8px; } .select { background-color:#aaa; } #loginbox { height:300px; padding:10px; } #signupbox { height:300px; padding:10px; display:none; } 原文地址: http://www.freejs.net/article_biaodan_142.html