hdv.js 1.98 KB
Newer Older
Pham Huy committed
1 2 3 4 5
/**
 * Created by DoanPV on 26/04/2019.
 */

if ($('.img-homepage').length) {
Pham Huy committed
6
	var scrollTrigger = 100, // px
Pham Huy committed
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

    backToTop = function () {
        var scrollTop = $(window).scrollTop();
        if (scrollTop > scrollTrigger) {
            $('.img-homepage').addClass('up-to-top-show');
        } else {
            $('.img-homepage').removeClass('up-to-top-show');
        }
    };

    backToTop();

    $(window).on('scroll', function () {
        backToTop();
    });

    $('.img-homepage').on('click', function (e) {
        e.preventDefault();
        $('html,body').animate({
            scrollTop: 0
        }, 700);
    });
}

$(document).ready(function(){
Pham Huy committed
32
    
Pham Huy committed
33 34 35 36 37 38 39 40
    $('.category_usage h5').on('click', function(){
        if($(this).attr('aria-expanded') == 'true'){
            $(this).find('.fa-angle-up').css('display','none');
            $(this).find('.fa-angle-down').css('display','block');
        }else{
            $(this).find('.fa-angle-up').css('display','block');
            $(this).find('.fa-angle-down').css('display','none');
        }
Pham Huy committed
41
	  });
Pham Huy committed
42
	
Pham Huy committed
43 44 45 46
    $('#price_slider').slick({
        dots: true,
        infinite: true,
        slidesToShow: 3,
Pham Huy committed
47
        slidesToScroll: 3,
Pham Huy committed
48
        autoplaySpeed: 2000,
Pham Huy committed
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
        responsive: [
            {
              breakpoint: 1024,
              settings: {
                slidesToShow: 3,
                slidesToScroll: 1,
                infinite: true,
                dots: true
              }
            },
            {
              breakpoint: 660,
              settings: {
                slidesToShow: 1,
                slidesToScroll: 1
              }
            },
            {
              breakpoint: 480,
              settings: {
                slidesToShow: 1,
                slidesToScroll: 1
              }
            }
            // You can unslick at a given breakpoint now by adding:
            // settings: "unslick"
            // instead of a settings object
          ]
Pham Huy committed
77
    });
Pham Huy committed
78 79
    // wow js
    new WOW().init();
Pham Huy committed
80
})