Advertisement
petar_bonov

mobile search page fix

Jul 22nd, 2024 (edited)
149
0
170 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     window.addEventListener("DOMContentLoaded", function () {
  2.         const decrypted = document.querySelector("#decrypted");
  3.  
  4.         decryptData(
  5.             IV, KEY, DATA,
  6.             function (text) {
  7.                 decrypted.innerHTML = text;
  8.  
  9.                 var swiperContainers = ["#news-container", "#reviews-container", "#latest-container", "#instores-container"];
  10.                 for (var i = 0; i < swiperContainers.length; i++) {
  11.                     try {
  12.                         if (!document.querySelector(swiperContainers[i])) continue; // missing container, skip
  13.  
  14.                         new Swiper(swiperContainers[i], {
  15.                             slidesPerView: 'auto',
  16.                             scrollbar: '.swiper-scrollbar',
  17.                             scrollbarHide: true,  
  18.                             spaceBetween: 0
  19.                         });
  20.                     } catch (error) {
  21.                         // swiper failed
  22.                     }
  23.                 }
  24.             },
  25.             function (error) {
  26.                 decrypted.innerHTML += `<div><b style="color: red;">ERROR:</b> ${error.toString()}</div>`;
  27.             }
  28.         );
  29.     });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement