JQuery toggle problem
- by Mazhar Ahmed
I'm using JQuery. I'm writing this as HTML code:
<li id="toggle">
<a id="open" class="open" href="#">Log In | Register</a>
<a id="close" class="close" style="display: none;" href="#">Close Panel</a>
</li>
and I'm writing a code like that:
$(document).ready(function() {
// Expand Panel
$("#open").click(function(){
$("div#panel").slideDown("slow");
});
// Collapse Panel
$("#close").click(function(){
$("div#panel").slideUp("slow");
});
// Switch buttons from "Log In | Register" to "Close Panel" on click
$("#toggle a").click(function () {
$("#toggle a").toggle();
});
});
They problem is that, it's working in a file. And after that I copied in in another file and it will not working.
There is no duplicate ID or anything else in the document