EDIT: see updated fiddle for an improved version of the search extension on the navigator :) (without undesirable behavior in chrome)
well, since he wants something else, as I thought in the first place, look at the fiddle . Some basic jquery functions are needed:
$(document).ready(function() { var trig = 1; //animate searchbar width increase to +150% $('#navbarsearch').click(function(e) { if (trig == 1){ $('#expandtrigger').animate({ width: '+=150' }, 400); trig ++; } //handle other nav elements visibility here $('.search-hide').addClass('hide'); }); // if user leaves the form the width will go back to original state $("#navbarsearch").focusout(function() { $('#expandtrigger').animate({ width: '-=150' }, 400); trig = trig - 1; //handle other nav elements visibility here $('.search-hide').removeClass('hide'); }); });
chwzr source share