templates/_partials/_script.html.twig line 1

Open in your IDE?
  1. <script src="{{ asset("/slick/jquery-3.6.0.min.js") }}" type="text/javascript"></script>
  2. <script src="{{ asset("/slick/jquery-migrate-3.4.0.min.js") }}"></script>
  3. <script src="{{ asset("/slick/slick.js?v2022") }}" type="text/javascript" charset="utf-8"></script>
  4. {#<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>#}
  5. {#<script src="{{ asset("/bootstrap.bundle.min.js") }}"></script>#}
  6. <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/js/bootstrap.bundle.min.js" integrity="sha384-u1OknCvxWvY5kfmNBILK2hRnQC3Pr17a+RTT6rIHI7NnikvbZlHgTPOOmMi466C8" crossorigin="anonymous"></script>
  7. <script src="https://cdn.jsdelivr.net/npm/bootstrap-select@1.14.0-beta3/dist/js/bootstrap-select.min.js"></script>
  8. <script src="https://cdn.jsdelivr.net/npm/bootstrap-select@1.14.0-beta3/dist/js/i18n/defaults-*.min.js"></script>
  9. <script src="{{ asset("/zoom/jquery.elevateZoom-3.0.8.min.js") }}"></script>
  10. <script src="{{ asset("/zoom/lightbox.min.js") }}"></script>
  11. <script src="{{ asset("/rSlider.min.js") }}"></script>
  12. <script>
  13.     function zoom(element) {
  14.         let elemt = $("#"+element);
  15.         elemt.elevateZoom({
  16.             scrollZoom: true,
  17.             zoomWindowFadeIn: 300,
  18.             zoomWindowFadeOut: 300,
  19.             lensFadeIn: 300,
  20.             lensFadeOut: 300,
  21.             zoomWindowHeight:250,
  22.             zoomWindowWidth:250,
  23.             easing : true,
  24.             borderSize: 1,
  25.             borderColour: '#048b9a',
  26.             responsive: true,
  27.             cursor: 'pointer',
  28.         });
  29.     }
  30.     // zoom("z-image-1")
  31.     $(".navbar-toggler").click(function (e) {
  32.         let cible = $('.navbar-collapse');
  33.         if (cible.hasClass("show")){
  34.             $(this).attr("data-bs-target","navbarText_no")
  35.             cible.removeClass('show');
  36.             cible.addClass('hide');
  37.         }else{
  38.             $(this).attr("data-bs-target","navbarText")
  39.             cible.addClass('show');
  40.             cible.removeClass('hide');
  41.         }
  42.     })
  43.     $(".product_one_block_link").click(function () {
  44.         window.location.href = $(this).attr("data-link");
  45.     })
  46.     function linkClick(linkData) {
  47.         window.location.href = linkData;
  48.     }
  49.     $(".show_image_with_color").click(function () {
  50.         let id = $(this).attr("id");
  51.         let idProduit = $(this).attr("data-id-produit")
  52.         let idColor = $(this).attr("data-id-color")
  53.         let typeColor = $(this).attr("data-type-color")
  54.         let urlImages = $(this).attr("data-url")
  55.         let cible = $(".show-img-selected-color-in-product");
  56.         $(".img_with_color").addClass("d-none");
  57.         $(".show_image_with_color_"+id).removeClass("d-none");
  58.         cible.html("<p class='text-center'>Chargement...</p>");
  59.         $.ajax({
  60.             method: "POST",
  61.             url: urlImages,
  62.             data: {"idProduit":idProduit,"idColor":idColor,"typeColor":typeColor,"isMobil":2},
  63.             // dataType: 'json'
  64.         }).done(function( images ) {
  65.             cible.html(images);
  66.             // $(".price-products-fiche").text($(".price_loaded").text());
  67.         });
  68.     })
  69.     $('.show_image_with_color_mobil').on('change', function (e) {
  70.         var optionSelected = $("option:selected", this);
  71.         let idProduit = optionSelected.attr("data-id-produit")
  72.         let idColor = optionSelected.attr("data-id-color")
  73.         let typeColor = optionSelected.attr("data-type-color")
  74.         let urlImages = optionSelected.attr("data-url")
  75.         let cible = $(".show-img-selected-color-in-product-mobil");
  76.         $(".img_with_color").addClass("d-none");
  77.         if (idProduit){
  78.             cible.html("<p class='text-center'>Chargement...</p>");
  79.             $.ajax({
  80.                 method: "POST",
  81.                 url: urlImages,
  82.                 data: {"idProduit":idProduit,"idColor":idColor,"typeColor":typeColor,"isMobil":1},
  83.                 // dataType: 'json'
  84.             }).done(function( images ) {
  85.                 cible.html(images);
  86.                 // $(".price-products-fiche").text($(".price_loaded").text());
  87.                 $('.center-list-sm').slick({
  88.                     centerMode: false,
  89.                     // centerPadding: '60px',
  90.                     slidesToShow: 1,
  91.                     infinite: false,
  92.                     dots: true,
  93.                 });
  94.             });
  95.         }
  96.     });
  97. </script>
  98. <script type="text/javascript">
  99.     $(document).on('ready', function() {
  100.         $('.center').slick({
  101.             centerMode: false,
  102.             // centerPadding: '60px',
  103.             slidesToShow: 3,
  104.             infinite: false,
  105.             responsive: [
  106.                 {
  107.                     breakpoint: 1193,
  108.                     settings: {
  109.                         arrows: true,
  110.                         centerMode: true,
  111.                         // centerPadding: '40px',
  112.                         slidesToShow: 1
  113.                     }
  114.                 },
  115.                 {
  116.                     breakpoint: 768,
  117.                     settings: {
  118.                         arrows: true,
  119.                         centerMode: true,
  120.                         // centerPadding: '40px',
  121.                         slidesToShow: 1
  122.                     }
  123.                 },
  124.                 {
  125.                     breakpoint: 480,
  126.                     settings: {
  127.                         arrows: true,
  128.                         centerMode: true,
  129.                         // centerPadding: '40px',
  130.                         slidesToShow: 1
  131.                     }
  132.                 }
  133.             ],
  134.             dots: true,
  135.         });
  136.         $('.center-list-sm').slick({
  137.             centerMode: false,
  138.             // centerPadding: '60px',
  139.             slidesToShow: 1,
  140.             infinite: false,
  141.             dots: true,
  142.         });
  143.         $('.port_center-list').slick({
  144.             centerMode: false,
  145.             // centerPadding: '60px',
  146.             slidesToShow: 1,
  147.             infinite: false,
  148.             dots: true,
  149.         });
  150.     });
  151. </script>
  152. <script type="text/javascript">
  153.     $('.option_select').selectpicker({
  154.         placeholder: 'Option'
  155.     });
  156.     $('.garantie_select').selectpicker({
  157.         placeholder: 'Garantie',
  158.     });
  159.     $('.color_select').selectpicker({
  160.         placeholder: 'Couleurs',
  161.     });
  162.     $('.sliders_0').slick({
  163.         infinite: false,
  164.         slidesToShow: 5,
  165.         slidesToScroll: 1,
  166.         arrows: true,
  167.         // centerMode: true,
  168.         variableHeight: true,
  169.         responsive: [
  170.             {
  171.                 breakpoint: 1200,
  172.                 settings: {
  173.                     slidesToShow: 4,
  174.                 }
  175.             },
  176.             {
  177.                 breakpoint: 991,
  178.                 settings: {
  179.                     slidesToShow: 3,
  180.                 }
  181.             },
  182.             {
  183.                 breakpoint: 767,
  184.                 settings: {
  185.                     slidesToShow: 2,
  186.                 }
  187.             }
  188.         ]
  189.     });
  190.     $('.sliders_1').slick({
  191.         infinite: false,
  192.         slidesToShow: 5,
  193.         slidesToScroll: 1,
  194.         arrows: true,
  195.         // centerMode: true,
  196.         variableHeight: true,
  197.         responsive: [
  198.             {
  199.                 breakpoint: 1200,
  200.                 settings: {
  201.                     slidesToShow: 4,
  202.                 }
  203.             },
  204.             {
  205.                 breakpoint: 991,
  206.                 settings: {
  207.                     slidesToShow: 3,
  208.                 }
  209.             },
  210.             {
  211.                 breakpoint: 767,
  212.                 settings: {
  213.                     slidesToShow: 2,
  214.                 }
  215.             }
  216.         ]
  217.     });
  218.     $('.sliders_2').slick({
  219.         infinite: false,
  220.         slidesToShow: 5,
  221.         slidesToScroll: 1,
  222.         arrows: true,
  223.         // centerMode: true,
  224.         variableHeight: true,
  225.         responsive: [
  226.             {
  227.                 breakpoint: 1200,
  228.                 settings: {
  229.                     slidesToShow: 4,
  230.                 }
  231.             },
  232.             {
  233.                 breakpoint: 991,
  234.                 settings: {
  235.                     slidesToShow: 3,
  236.                 }
  237.             },
  238.             {
  239.                 breakpoint: 767,
  240.                 settings: {
  241.                     slidesToShow: 2,
  242.                 }
  243.             }
  244.         ]
  245.     });
  246.     (function () {
  247.         'use strict';
  248.         var init = function () {
  249.             var sliderInput1 = new rSlider({
  250.                 target: '#sliderInput1',
  251.                 values: ["2 à 4 plcs","5 à 6 plcs", "6 à 8 plcs", "9 plcs et +"],
  252.                 range: false,
  253.                 tooltip: true,
  254.                 scale: false,
  255.                 labels: true,
  256.                 step: 0,
  257.                 set: ["2 à 4 plcs"],
  258.                 onChange: function (vals) {
  259.                     // console.log(vals);
  260.                 }
  261.             });
  262.             var sliderInput2 = new rSlider({
  263.                 target: '#sliderInput2',
  264.                 values: [0+" €",4500+" €", 6500+" €", 8500+" €", 10000+" €", 15000+" €", 20000+" € et +"],
  265.                 range: true,
  266.                 tooltip: true,
  267.                 scale: false,
  268.                 labels: false,
  269.                 step: 0,
  270.                 set: [0+" €", 20000+" € et +"],
  271.                 onChange: function (vals) {
  272.                     // console.log(vals);
  273.                 }
  274.             });
  275.         };
  276.         window.onload = init;
  277.     })();
  278.     // $("body").click(function () {
  279.     //     console.log(mySlider.getValue());
  280.     // })
  281. </script>