kartul Posted April 7, 2011 Share Posted April 7, 2011 Hey all I want to make that when I click on login, the login div appears (and if registration div is visible, hide it first) and vise-versa. here is my code so far: <script> $(document).ready(function() { $("#tLogin").click(function() { $("#login").slideToggle("slow"); }); $("#tRegister").click(function() { $("#register").slideToggle("slow"); }); }); </script> <div id="pHeader"> <div id="login"> <form action="index.php" method="POST"> <p> <label for="username">Username</label> <input type="text" name="username" id="username"> </p> <p> <label for="password">Password</label> <input type="password" name="password" id="password"> </p> <p> <input type="submit" name="login"> </p> </form> </div> <div id="register"> <form action="index.php" method="POST"> <p> <label for="username">Username</label> <input type="text" name="username" id="username"> </p> <p> <label for="password">Password</label> <input type="password" name="password" id="password"> </p> <p> <label for="password">Password</label> <input type="password" name="passwordCheck" id="passwordCheck"> </p> <p> <label for="email">E-mail</label> <input type="email" name="email" id="email"> </p> <p> <input type="submit" name="register"> </p> </form> </div> Quote Link to comment Share on other sites More sharing options...
Adam Posted April 8, 2011 Share Posted April 8, 2011 Try this: $(document).ready(function() { $("#tLogin").click(function() { $("#login").slideToggle("slow"); if (("#register").is(":visible")) { $("#register").hide(); } }); $("#tRegister").click(function() { $("#register").slideToggle("slow"); if (("#login").is(":visible")) { $("#login").hide(); } }); }); Quote Link to comment Share on other sites More sharing options...
yogi123 Posted September 23, 2011 Share Posted September 23, 2011 You can get it here, try this http://www.webtrickss.com/javascript/jquery-slidetoggle-signup-form-and-login-form/ Hope it will help full for you! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.