Created
February 25, 2013 10:47
-
-
Save libo1106/5029072 to your computer and use it in GitHub Desktop.
搜索框提示按钮
This file contains hidden or 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
/* 搜索框 */ | |
if( $('.search').length != 0){ | |
var search = $('.search'); | |
var search_enter = $('.search_enter'); | |
search_enter.hide(); | |
search.on({ | |
keyup : function(){ | |
console.log('keyup'); | |
search.val().length != 0 ? search_enter.show() : search_enter.hide(); | |
}, | |
change : function(){ | |
console.log('change'); | |
search.val().length != 0 ? search_enter.show() : search_enter.hide(); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment