Created
September 26, 2012 08:40
-
-
Save ozgun/3786832 to your computer and use it in GitHub Desktop.
puan
This file contains 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 characters
var tumPuanlarTmp = []; | |
var tumPuanlar = []; | |
$('div.urunler div').each(function(idx, el) { | |
tumPuanlar.push(parseInt($(el).attr('data-puan'))); | |
}); | |
tumPuanlar = jQuery.unique(tumPuanlar); | |
tumPuanlar = tumPuanlar.sort(function(a,b){return a-b}); | |
var puan = 12; | |
var bulunanPuanlar = [] | |
var tmp = -1; | |
jQuery.each(tumPuanlar, function() { | |
var num = parseInt(this); | |
if (num <= puan) { | |
bulunanPuanlar.push(num); | |
} | |
}); | |
$('div.urunler > div').hide(); | |
jQuery.each(bulunanPuanlar, function() { | |
var elm = 'div.urunler > div[data-puan=' + this + ']'; | |
console.log(elm); | |
$(elm).show(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment