-
-
Save lalitkapoor/2919953 to your computer and use it in GitHub Desktop.
wordpress jquery search field behavior
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// search box behavior text behavior | |
$('.searchField').focus(function(){ | |
$('#searchsubmit,.searchWrapper').addClass('active'); | |
$('.searchField').val(''); | |
}); | |
$('.searchField').blur(function(){ | |
$('#searchsubmit,.searchWrapper').removeClass('active'); | |
if($('.searchField').val() == '') | |
$('.searchField').val('Search...'); | |
}); | |
$('#searchform').submit(function(e){ | |
if ($('.searchField').val() == 'Search...') { | |
e.preventDefault(); | |
} else { | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment