Advertisement
Webotvurci

Gymio - david

Jun 18th, 2021
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Přidat podnadpisy pro každou variantu tabu
  2. if (jQuery("body").hasClass("in-index")) {
  3.   jQuery('<div id="textUnderCopy"></div>').insertBefore(jQuery("#tab-content"));
  4.  
  5.   // Function definition
  6.   function textUnderSelector(temp) {
  7.  
  8.     switch (temp) {
  9.       case "Pro tělo":
  10.         jQuery("#textUnderCopy").html("TEST1");
  11.         break;
  12.       case "Na sebe":
  13.         jQuery("#textUnderCopy").html("TEST2");
  14.         break;
  15.       case "Ke cvičení":
  16.         jQuery("#textUnderCopy").html("TEST3");
  17.         break;
  18.       default:
  19.         jQuery("#textUnderCopy").html("TEST4");
  20.     }
  21.  
  22.   }
  23.   // Inilization
  24.   textUnderSelector();
  25.   // change event
  26.   jQuery("#homepage-tabs .shp-tab-link").click(function () {
  27.     var temp = jQuery(this).text();
  28.     temp = temp.trim()
  29.     textUnderSelector(temp)
  30.   });
  31.  
  32.  
  33.   // slider
  34.   jQuery('.products-block').slick({
  35.     dots: true,
  36.     infinite: true,
  37.     speed: 300,
  38.     slidesToShow: 4,
  39.     slidesToScroll: 4,
  40.     responsive: [{
  41.         breakpoint: 1024,
  42.         settings: {
  43.           slidesToShow: 3,
  44.           slidesToScroll: 3,
  45.           infinite: true,
  46.           dots: true
  47.         }
  48.       },
  49.       {
  50.         breakpoint: 600,
  51.         settings: {
  52.           slidesToShow: 2,
  53.           slidesToScroll: 2
  54.         }
  55.       },
  56.       {
  57.         breakpoint: 480,
  58.         settings: {
  59.           slidesToShow: 1,
  60.           slidesToScroll: 1
  61.         }
  62.       }
  63.       // You can unslick at a given breakpoint now by adding:
  64.       // settings: "unslick"
  65.       // instead of a settings object
  66.     ]
  67.   });
  68.  
  69.   //Zaměnit pořadí Skladem a popis produktu (přes CSS mi to už nešlo, není to ve stejném divu)
  70.   //Za popis produktu přidat link celý popis vedoucí na produkt
  71.   jQuery(".product").each(function (index) {
  72.     var href = jQuery(this).find(".image").attr("href");
  73.     var text = jQuery(this).find(".p-desc").text();
  74.     var availability = jQuery(this).find(".availability").html();
  75.     jQuery(this).find(".p-desc").html(text + '<a href="' + href + '">celý text</a>');
  76.     jQuery(availability).insertAfter(jQuery(this).find(".p-desc"));
  77.   });
  78.  
  79.   //Přesunout instagram z patičky nad patičku a nastavit ho na 2x6 (Shoptet umí jen do patičky a 2x4)
  80.   jQuery("<div id='instagramnew'>" + jQuery(".instagram-widget").html() + "</div>").insertAfter(jQuery("#content-wrapper"));
  81.  
  82. }
  83.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement