标签:
模糊搜索keyup无效,解决方案如下
//手机网站解决keyup的方法
$(function () {
$(‘#repairsearch‘).bind(‘focus‘, filter_time);
});
var str = ‘‘;
//传入参数
var now = ‘‘;
filter_time = function () {
var time = setInterval(filter_staff_from_exist, 100);
$(this).bind(‘blur‘, function () {
clearInterval(time);
});
};
filter_staff_from_exist = function () {
now = $.trim($(‘#repairsearch‘).val());
if (now != str) {
LoadData(1, 0); //加载数据
}
str = now;
标签:
原文地址:http://www.cnblogs.com/xy99/p/5545356.html