Advertisement
Guest User

Untitled

a guest
May 22nd, 2015
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. (function ($) {
  2. jQuery.expr[':'].Contains = function(a,i,m){
  3. return (a.textContent || a.innerText || "").toUpperCase().indexOf(m[3].toUpperCase())>=0;
  4. };
  5.  
  6. function listFilter(header, list) {
  7. var form = $("<form>").attr({"class":"filterform","action":"#"}),
  8. input = $("<input>").attr({"class":"filterinput","type":"text", "placeholder":"Pretraga..."});
  9. $(form).append(input).appendTo(header);
  10.  
  11. $(input)
  12. .change( function () {
  13. var filter = $(this).val();
  14. if(filter) {
  15. $(list).find(".clubTitle:not(:Contains(" + filter + "))").parent().slideUp();
  16. $(list).find(".clubTitle:Contains(" + filter + ")").parent().slideDown();
  17. } else {
  18. $(list).find(".entry").slideDown();
  19. }
  20. return false;
  21. })
  22. .keyup( function () {
  23. $(this).change();
  24. });
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement