problem with toggle (shows and hides many times)
I made a toogle navigation and it doesn't work. when I click on a link in the menu, the toogle appears and disappears several times. I'm really new in jquery. Could you help please?
- <script type="text/javascript">
- $(document).ready(function(){
- $(".btn-open").click(function(){
- $("#panel").slideToggle("slow");
- });
- $(window).resize(function(){
- if ($(window).width() < 1024) {
- $(".navigation li").click(function() {
- $("#panel").slideToggle("slow");
- });
- $("#panel").val('Close').toggle();
- }
- });
- });
- </script>