Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. $('.prd-price .price').each(function () {
  2. var price = $(this).data('price') * 1;
  3. if ($(this).data('price') !== undefined) {
  4. if (price < minprice || price > maxprice) {
  5. $(this).closest('.list-item').hide();
  6. } else {
  7. $(this).closest('.list-item').show();
  8. }
  9. }
  10. })
  11.  
  12. var test = document.getElementsByClassName('list-item');
  13. var nodes = Array.prototype.slice.call(test);
  14.  
  15. var result = nodes.filter(function (node) {
  16. return node.style.display != "none"
  17. }).length
  18.  
  19. if (result == 0) {
  20. $('#productListBox').append(nodata);
  21. } else if (result > 0 && result < 5) {
  22. $('#listNoData').remove();
  23. $('#btnGetMore').addClass('hidden');
  24. } else if (result == 5) {
  25. $('#btnGetMore').removeClass('hidden');
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement