result.js 5.26 KB
Newer Older
nabil el mahiri committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163
jQuery(function($) {
    "use strict";

    var SLZ = window.SLZ || {};


    /*=======================================
    =             MAIN FUNCTION             =
    =======================================*/

    SLZ.mainFunction = function() {

        // Select box stacking order
        $('.result-filter-wrapper .select-wrapper').each(function(i) {
            $(this).css('z-index', 100 - i);
        });

        $('.result-wrapper').slick({
            infinite: true,
            slidesToShow: 8,
            slidesToScroll: 8,
            speed: 2000,
            responsive: [
                {
                    breakpoint: 769,
                    settings: {
                        slidesToShow: 6,
                        slidesToScroll: 6,
                        arrows: false,
                        dots: true,
                        autoplay: true,
                        autoplaySpeed: 5000,
                    }
                },
                {
                    breakpoint: 601,
                    settings: {
                        slidesToShow: 4,
                        slidesToScroll: 4,
                        arrows: false,
                        dots: true,
                        autoplay: true,
                        autoplaySpeed: 5000,
                    }
                },
                {
                    breakpoint: 481,
                    settings: {
                        slidesToShow: 3,
                        slidesToScroll: 3,
                        arrows: false,
                        dots: true,
                        autoplay: true,
                        autoplaySpeed: 5000,
                    }
                },
                {
                    breakpoint: 321,
                    settings: {
                        slidesToShow: 2,
                        slidesToScroll: 2,
                        arrows: false,
                        dots: true,
                        autoplay: true,
                        autoplaySpeed: 5000,
                    }
                },
            ]
        });

        /* slider */

        $('.wrapper-cd-detail').slick({
            slidesToShow: 1,
            slidesToScroll: 1,
            arrows: true,
            fade: true,
            asNavFor: '.wrapper-cd-detail-thumnail'
        });
        $('.wrapper-cd-detail-thumnail').slick({
            slidesToShow: 5,
            slidesToScroll: 1,
            asNavFor: '.wrapper-cd-detail',
            // centerMode: true,
            focusOnSelect: true,
            arrows: false,
            responsive: [
                {
                    breakpoint: 769,
                    settings: {
                        slidesToShow: 4,
                        slidesToScroll: 1,
                        autoplaySpeed: 5000,
                    }
                },
                {
                    breakpoint: 601,
                    settings: {
                        slidesToShow: 3,
                        slidesToScroll: 1,
                        arrows: false,
                        autoplay: true,
                        autoplaySpeed: 5000,
                    }
                },
                {
                    breakpoint: 481,
                    settings: {
                        slidesToShow: 2,
                        slidesToScroll: 1,
                        arrows: false,
                        autoplay: true,
                        autoplaySpeed: 5000,
                    }
                }
            ]
        });

        $('.btn-book-tour').click(function(event) {
            /* Act on the event */
            event.preventDefault();
            $(this).parent().next('.timeline-book-block').toggleClass('show-book-block');
        });

        setTimeout(function() {
            if (window.innerWidth < 769) {

                $('.timeline-custom-col.content-col').each(function(index, el) {
                    var height_for_point = $(this).height()/2;
                    $(this).prev().css('top',height_for_point);
                });
                $('.timeline-block:last-child .timeline-point').css('height', $('.timeline-block:last-child .timeline-content').height()-150);
            }
            else {

                $('.timeline-custom-col.content-col').each(function(index, el) {
                    if ($(this).height() > 250) {

                        $(this).prev().css('top', '125px');            
                        $('.timeline-block:last-child .timeline-point').css('height', $('.timeline-block:last-child .content-col').height()-100);
                    }
                    else
                        $('.timeline-block:last-child .timeline-point').css('height', $('.timeline-block:last-child .content-col').height()-30);

                });
            }
        },2000);

    };

    /*======================================
    =            INIT FUNCTIONS            =
    ======================================*/

    $(document).ready(function() {
        SLZ.mainFunction();
    });

    /*======================================
    =          END INIT FUNCTIONS          =
    ======================================*/

});