Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Make for appear when you click another item: Reply To: Make for appear when you click another item:

#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");
});