Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function changeUser() {
  2.     var value = $('#users').val();
  3.     $('#info').html('');
  4.     $('#list').each( function(index) {
  5.         act = $(this).text().split(" ");
  6.         for ( var i in act ) {
  7.             tmp = act[i];
  8.             if( tmp.indexOf( value ) > 1 ) {
  9.                 tmp = $('#info').html() + tmp;
  10.                 $('#info').html( tmp );
  11.             }
  12.         }
  13.     });
  14.     pressed=0;
  15. }
  16. function changeUserS() {
  17.     if(!pressed) {
  18.         pressed=1;
  19.     }
  20.     else {
  21.         clearTimeout(timeout);
  22.     }
  23.     timeout=setTimeout(changeUser(),300);
  24. }
  25. $('#users').keypress(changeUserS);
  26. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement