javascript - jQuery slideToggle keeps repeating -


i have simple jquery code looks this:

$( "#resp-navigation" ).one("click", function() {     $( "#navigation" ).slidetoggle(500); }); 

my html looks this:

<div id="resp-navigation"> ... </div> <nav id="navigation"> ... </nav> 

my problem when click on #resp-navigation div, #navigation keeps toggling. meybe know why?

thanks.

if intention have '#navigation' div toggle each time clicks on '#resp-navigation' div, then:

this: $( "#resp-navigation" ).one

should be: $( "#resp-navigation" ).on

and works fine in fiddle:

http://jsfiddle.net/us0dm62c/

if, however, intention ever have '#navigation' div toggle once (so disappears , cannot shown again), code no modifications, can see in fiddle:

http://jsfiddle.net/gktnhhm5/


Comments

Popular posts from this blog

html - height not adding height to a empty div -

Oracle SQL. How to select specific IDs where value of columns specify criteria? -

python - Robot Framework location and name of keyword -