Hello
There is a button of this type:
<div class="log-in"><img src="{THEME}/images/log-in.png" alt="log-in" /><a href="">Войти</a></div>
And the panel that when you press the button should go:
<div class="panel"> <form method="post" action=""> <label for="login_name">{login-method}</label><input type="text" name="login_name" id="login_name" /> <label for="login_password">Пароль (<a href="{lostpassword-link}">Забыли?</a>):</label><input type="password" name="login_password" id="login_password" /> <button class="fbutton" onclick="submit();" type="submit" title="Войти"><span>Войти</span></button> <input name="login" type="hidden" id="login" value="submit" /> <a href="{registration-link}">Регистрация</a> </form> </div>
CSS:
.panel{width:200px; height:150px; background:#F00; display:none;}
jQuery:
<script type="text/javascript"> $(document).ready(function () { $(".log-in").click(function(){ $(".panel").slideToggle("slow"); return false; }) }); </script>
The problem is that when the button is .panel
, the panel opens, but when the input
field is .panel
inside the .panel
, it is hidden again. Help please, or write how to make a script correctly.