Skip to content

Instantly share code, notes, and snippets.

@ozgun
Created September 26, 2012 08:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ozgun/3786832 to your computer and use it in GitHub Desktop.
Save ozgun/3786832 to your computer and use it in GitHub Desktop.
puan
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