Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function ($) {
- jQuery.expr[':'].Contains = function(a,i,m){
- return (a.textContent || a.innerText || "").toUpperCase().indexOf(m[3].toUpperCase())>=0;
- };
- function listFilter(header, list) {
- var form = $("<form>").attr({"class":"filterform","action":"#"}),
- input = $("<input>").attr({"class":"filterinput","type":"text", "placeholder":"Pretraga..."});
- $(form).append(input).appendTo(header);
- $(input)
- .change( function () {
- var filter = $(this).val();
- if(filter) {
- $(list).find(".clubTitle:not(:Contains(" + filter + "))").parent().slideUp();
- $(list).find(".clubTitle:Contains(" + filter + ")").parent().slideDown();
- } else {
- $(list).find(".entry").slideDown();
- }
- return false;
- })
- .keyup( function () {
- $(this).change();
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement