Home › Forums › JavaScript › Make for appear when you click another item: › Reply To: Make for appear when you click another item:
November 4, 2015 at 2:16 pm
#210553
michaellee
Participant
You could use simple class states.
So in your CSS you could have
form.search-form{
display: none;
}
form.search-form.is-showing{
display: block;
}
Then in your JavaScript (assuming you use jQuery), you could toggle the class on and off.
$("li.search.icon.menu-item").on("click", function(){
$("form.search-form").toggleClass("is-showing");
});