I have a search box that is small in normal state. on focus it expands, and a submit button shows up. This was done to save space. now, on blur, the search box shrinks again, and the submit button goes away.
Problem is, the click to the submit button IS the blur (which happens before it gets submit) there by making the submit button a 'race' to click it in the right spot.
I don't want to use an interval/timer... over kill.
Ideally, i just want the blur to not happen if focus is on the submit button.
$('#searchtext').focus(function() {
$('#searchtext').stop().animate({'width':'175px'} , 800);
$('#ctrl_search').fadeIn('slow');
});
$('#searchtext').blur(function() {
$('#searchtext').stop().animate({'width':'85px'} , 800);
$('#ctrl_search').fadeOut('slow');
});
searchtext is the input
ctrl_search is the submit button
I want to change
$('#searchtext').blur(function() {
to something like:
$('#searchtext').blur.not$('#ctrl_search').focus())(function() {
but that obviously doesn't work. lol
Can something like this be fanageled?
help!