html - Change DIV display value using Javascript/Jquery function -


update: fixed , working. help.

hello i'm making javascript/jquery button when clicked, div appears (display: inline-block), , when clicked again div goes display: none. ideally want animate movement, want working first.

my button...

 <button> menu test </button> 

my function (updated)...

<script>  $("button").click(function(){     $("#flexmenu").toggle("slow", function() {  }); });  </script> 

the css flexmenu...

 #flexmenu {  /* display: inline-block;*/   position: fixed;   float: left;   background: #1f1f1f;   margin: 3.9em 0 0 0;   padding: .25em;   width: 15%;   height: 6em;   border: 2px solid #fff;   z-index: 100;  } 

i'm sure how grab display property of id , change it. i've done hover function before using css ease-out make divs grow in size when hovered , change class using $(this).toggleclass(nameofclass), have never tried changing element. other questions didn't fit changing display value. help.

you should use jquery :

$("button").click(function(){     $("#flexmenu").toggle(); }); 

Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -