jquery - Click function .slideToggle After open -


// toggle $('#toggle').click(function() {   $('.extra').slidetoggle(); });  .extra {     display: none; }   #toggle {  cursor:pointer;  width:100%;  display:block;  text-align: center;  padding:10px 0;  color:#777;  } 

using font awesome fa fa-chevron-down im trying make once slidetoggle has been opened changes fa fa-chevron-down

im pretty sure simple cant seem find

$('#toggle').click(function() {   $('.extra').slidetoggle(400, function(){     $("#toggle .additionalclasstotheicon").toggleclass("fa-chevron-up fa-chevron-down");   }); }); 

where 400 duration of animation, can change whatever want. additionalclasstotheicon additional class icon can identify it.

also check documentation:

http://api.jquery.com/slidetoggle/

http://api.jquery.com/toggleclass/


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -