So.. we had this issue with live search, it could be a bit shaky in producing result when user actually put a long keyword. Came across this lightweight plugin called 'typing' :
or if you prefer the github link :
https://github.com/narfdotpl/jquery-typing
using it is pretty simple too :
$(':text').typing({ start: function (event, $elem) { $elem.css('background', '#fa0'); }, stop: function (event, $elem) { $elem.css('background', '#f00'); }, delay: 400 });
It will wait until the user actually not pressing any other key and then fire the keyup. We combine it with our liveSearch and it works very well!
No comments:
Post a Comment