Home › Forums › CSS › search-form › Re: search-form
January 30, 2013 at 10:52 am
#122840
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