{"action":"opened","issue":{"url":"https://api.github.com/repos/metafizzy/isotope/issues/1005","labels_url":"https://api.github.com/repos/metafizzy/isotope/issues/1005/labels{/name}","comments_url":"https://api.github.com/repos/metafizzy/isotope/issues/1005/comments","events_url":"https://api.github.com/repos/metafizzy/isotope/issues/1005/events","html_url":"https://github.com/metafizzy/isotope/issues/1005","id":117197950,"number":1005,"title":"Combination filter with jQuery UI Slider","user":{"login":"ronnsson","id":7203873,"avatar_url":"https://avatars.githubusercontent.com/u/7203873?v=3","gravatar_id":"","url":"https://api.github.com/users/ronnsson","html_url":"https://github.com/ronnsson","followers_url":"https://api.github.com/users/ronnsson/followers","following_url":"https://api.github.com/users/ronnsson/following{/other_user}","gists_url":"https://api.github.com/users/ronnsson/gists{/gist_id}","starred_url":"https://api.github.com/users/ronnsson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ronnsson/subscriptions","organizations_url":"https://api.github.com/users/ronnsson/orgs","repos_url":"https://api.github.com/users/ronnsson/repos","events_url":"https://api.github.com/users/ronnsson/events{/privacy}","received_events_url":"https://api.github.com/users/ronnsson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-16T19:19:36Z","updated_at":"2015-11-16T19:19:36Z","closed_at":null,"body":"Hey!\r\nI'm trying to integrate a couple of jQuery UI Sliders with Isotope and filtering. I've gotten the filtering to work sort of but my two sliders are only working separately. I've tried a couple of variations of code but here's the most recent one:\r\n\r\njQuery:\r\n        var val1 = 0;\r\n        var val2 = 0;\r\n        // filter functions\r\n        var filterFns = {\r\n            feature1: function() {\r\n                var number = $(this).attr(\"data-feature1\");\r\n                // return true to show, false to hide\r\n                return parseInt( number ) > val1;\r\n            },\r\n\r\n            feature2: function() {\r\n                var number = $(this).attr(\"data-feature2\");\r\n                // return true to show, false to hide\r\n                return parseInt( number ) > val2;\r\n            }\r\n        };\r\n\r\n        // init Isotope\r\n        var $siteContainer = $('#casinos').isotope({ \r\n            itemSelector: '.item',\r\n            filter: function() {\r\n                var isMatched = true;\r\n                var $this = $(this);\r\n\r\n                for ( var prop in siteFilters ) {\r\n                    var filter = siteFilters[ prop ];\r\n                    // use function if it matches\r\n                    filter = filterFns[ filter ];\r\n                    // test each filter\r\n                    isMatched = isMatched && $(this).is( filter );\r\n                }\r\n                return isMatched;\r\n            }\r\n        });\r\n\r\n        // store filter for each group\r\n        var siteFilters = {};\r\n\r\n        var slider = $('.site-slider').slider({\r\n            min: 0,\r\n            max: 98,\r\n            range: \"min\",\r\n            value: 50,\r\n            slide: function( event, ui ) {\r\n                var $this = $(this);\r\n                \r\n                if($(this).attr('data-filter') == 'feature1' ){\r\n                    val1=ui.value;\r\n                }\r\n                if($(this).attr('data-filter') == 'feature2' ){\r\n                    val2=ui.value;\r\n                }\r\n\r\n                console.log(val1+\" \"+val2);\r\n                // get group key\r\n                var $buttonGroup = $this.parents('.sliders');\r\n                var filterGroup = $buttonGroup.attr('data-filter-group');\r\n                siteFilters[ filterGroup ] = $this.attr('data-filter');\r\n                // combine filters\r\n                $siteContainer.isotope('arrange');\r\n            }\r\n        });\r\n\r\nThanks beforehand!"}}