javascript - how to make hidden elements to pop up faster (jquery/ css) -


i made search panel hidden @ page load. when user clicks on search icon, popup appears (pop up) search form text box. current codes, way search form popping slow though didn't add transition css. there wrong below jquery , not css problem?

  jquery( ".search-icon" ).click(function() {         jquery('.search-form').fadein(0);     return false;   }); });  .search-form {     display: none;     clear: both;     z-index: 2;     position: absolute;     right: 0; } 

jquery(".search-icon").click(function() {    jquery('.search-form').toggle();    return false;  });
.search-form {    display: none;    clear: both;    z-index: 2;    position: absolute;    right: 0;  }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>    <div class='search-icon'>icon</div>  <div class='search-form'>search form</div>

from w3schools.com jquery effect fadeout() method:

the fadeout() method gradually changes opacity, selected elements, visible hidden (fading effect).

$(selector).fadeout(speed,easing,callback); 

Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -