rAthus

BoobyLegends Market sort by pts/gem

Apr 13th, 2023 (edited)
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var $wrapper = $('#ecran-market-buy .listing-market-cards');
  2. $wrapper.find('.wrapper-market-card').sort(function(a,b) {
  3.     var v1 = ($(a).find('.score-card span').text()*1)/($(a).find('.cost span').text()*1);
  4.     var v2 = ($(b).find('.score-card span').text()*1)/($(b).find('.cost span').text()*1);
  5.     $(a).find('.pornstar-number').html('<span style="background:yellow;color:black;">&nbsp;<strong>'+(Math.round(v1*100)/100)+'</strong>&nbsp;pts/gem&nbsp;</span>');
  6.     $(b).find('.pornstar-number').html('<span style="background:yellow;color:black;">&nbsp;<strong>'+(Math.round(v2*100)/100)+'</strong>&nbsp;pts/gem&nbsp;</span>');
  7.     return v2-v1;
  8. }).appendTo($wrapper);
Add Comment
Please, Sign In to add comment