Advertisement
bongzilla

Untitled

Jan 14th, 2021
1,548
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.56 KB | None | 0 0
  1. $( document ).ready(function() {
  2.     const wishlistDiv = $("a[href='/wishlist']").eq(0);
  3.  
  4.     if(Number($('[data-wc="wl_count"]')[0].innerText) === 0) {
  5.         $('[data-wc="wl_count"]').eq(0).hide();
  6.     }
  7.  
  8.     $(".action.wishlst").on("click", function(e) {
  9.         console.log("wishlist clicked");
  10.         const wishlistCount = $('[data-wc="wl_count"]').eq(0);
  11.  
  12.         setTimeout(() => {
  13.             let count = $('[data-wc="wl_count"]')[0].innerText;
  14.             console.log("count is", count);
  15.  
  16.             if(count > 0) {
  17.                 wishlistCount.show();
  18.             } else {
  19.                 wishlistCount.hide();
  20.             }
  21.  
  22.         }, 2500)
  23.     });
  24. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement