Last active
September 21, 2015 14:06
-
-
Save A/b56b2d7310bc0b7df563 to your computer and use it in GitHub Desktop.
Revisions
-
A revised this gist
Sep 21, 2015 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,6 @@ function Test(str, offset) { if (i >= str.length) return; var e = $.Event('input', { keyCode: str.charCodeAt(i) }); var val = $search.val(); $search .val(val + str[i]) .trigger(e) -
A created this gist
Sep 21, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ new Test('Hello World', 200); // try to change offset function Test(str, offset) { var i = 0; var $search = $('.sel-search-input'); $search.val('').focus(); (function next() { setTimeout(function() { if (i >= str.length) return; var e = $.Event('input', { keyCode: str.charCodeAt(i) }); var val = $search.val(); $search .val(val + str[i]) .trigger(e) ; i++; next(); }, offset); })(); }