Forums

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

Home Forums CSS search-form Re: search-form

#122840
simoncmason
Member

Are you using jQuery on your site? If so you could simply toggle a class on click:

// Add a class to the search icon when clicked
$(‘#viewSearch’).click(function() {
$(this).toggleClass(“searchOpen”);
});

Then hook your animation to this class which you can do by changing the width from 0 to 50% for example and transitioning the change

Example on CodePen here: http://cdpn.io/bqgta