diff options
author | prashantsinalkar | 2019-04-22 12:35:05 +0530 |
---|---|---|
committer | prashantsinalkar | 2019-04-22 12:35:05 +0530 |
commit | 4ba4ccc3fddb242251d5442c78aba14f43835035 (patch) | |
tree | 143fb83eb49ec1001e5be0ca87302858f6bca6fe /js/scripts.js | |
parent | 4dc90c39ae1a07db5f6f567fae84513c69ca1ac1 (diff) | |
download | osdag_workshop_2019-4ba4ccc3fddb242251d5442c78aba14f43835035.tar.gz osdag_workshop_2019-4ba4ccc3fddb242251d5442c78aba14f43835035.tar.bz2 osdag_workshop_2019-4ba4ccc3fddb242251d5442c78aba14f43835035.zip |
created index page
Diffstat (limited to 'js/scripts.js')
-rwxr-xr-x | js/scripts.js | 193 |
1 files changed, 193 insertions, 0 deletions
diff --git a/js/scripts.js b/js/scripts.js new file mode 100755 index 0000000..d7da37d --- /dev/null +++ b/js/scripts.js @@ -0,0 +1,193 @@ +(function($) { +$(document).ready(function() { + $('.single-item').slick({ + dots: true, + infinite: true, + speed: 300, + slidesToShow: 1, + slidesToScroll: 1 + }); + $('.multiple-items').slick({ + dots: true, + infinite: true, + speed: 300, + slidesToShow: 3, + slidesToScroll: 3 + }); + $('.one-time').slick({ + dots: true, + infinite: true, + speed: 300, + slidesToShow: 1, + adaptiveHeight: true + }); + $('.uneven').slick({ + dots: true, + infinite: true, + speed: 300, + slidesToShow: 4, + slidesToScroll: 4 + }); + $('.responsive').slick({ + dots: true, + infinite: false, + speed: 300, + slidesToShow: 4, + slidesToScroll: 4, + responsive: [{ + breakpoint: 1024, + settings: { + slidesToShow: 3, + slidesToScroll: 3, + infinite: true, + dots: true + } + }, { + breakpoint: 600, + settings: { + slidesToShow: 2, + slidesToScroll: 2 + } + }, { + breakpoint: 480, + settings: { + slidesToShow: 1, + slidesToScroll: 1 + } + }] + }); + + $('.center').slick({ + centerMode: true, + infinite: true, + centerPadding: '60px', + slidesToShow: 3, + responsive: [{ + breakpoint: 768, + settings: { + arrows: false, + centerMode: true, + centerPadding: '40px', + slidesToShow: 3 + } + }, { + breakpoint: 480, + settings: { + arrows: false, + centerMode: true, + centerPadding: '40px', + slidesToShow: 1 + } + }] + }); + $('.lazy').slick({ + lazyLoad: 'ondemand', + slidesToShow: 3, + slidesToScroll: 1 + }); + $('.autoplay').slick({ + dots: true, + infinite: true, + speed: 300, + slidesToShow: 3, + slidesToScroll: 1, + autoplay: true, + autoplaySpeed: 2000 + }); + + $('.fade').slick({ + dots: true, + infinite: true, + speed: 500, + fade: true, + slide: 'div', + cssEase: 'linear' + }); + + $('.add-remove').slick({ + dots: true, + slidesToShow: 3, + slidesToScroll: 3 + }); + var slideIndex = 1; + $('.js-add-slide').on('click', function() { + slideIndex++; + $('.add-remove').slickAdd('<div><h3>' + slideIndex + '</h3></div>'); + }); + + $('.js-remove-slide').on('click', function() { + $('.add-remove').slickRemove(slideIndex - 1); + if (slideIndex !== 0){ + slideIndex--; + } + }); + + $('.filtering').slick({ + dots: true, + slidesToShow: 4, + slidesToScroll: 4 + }); + var filtered = false; + $('.js-filter').on('click', function() { + if (filtered === false) { + $('.filtering').slickFilter(':even'); + $(this).text('Unfilter Slides'); + filtered = true; + } else { + $('.filtering').slickUnfilter(); + $(this).text('Filter Slides'); + filtered = false; + } + }); + + $('.slider-for').slick({ + slidesToShow: 1, + slidesToScroll: 1, + arrows: false, + fade: true, + asNavFor: '.slider-nav' + }); + $('.slider-nav').slick({ + slidesToShow: 3, + slidesToScroll: 1, + asNavFor: '.slider-for', + dots: true, + centerMode: true, + focusOnSelect: true + }); + + $(window).on('scroll', function() { + if ($(window).scrollTop() > 166) { + $('.fixed-header').show(); + } else { + $('.fixed-header').hide(); + } + }); + + $('ul.nav a').on('click', function(event) { + event.preventDefault(); + var targetID = $(this).attr('href'); + var targetST = $(targetID).offset().top - 48; + $('body, html').animate({ + scrollTop: targetST + 'px' + }, 300); + }); + + $('.single-item-rtl').slick({ + dots: true, + infinite: true, + speed: 300, + slidesToShow: 1, + slidesToScroll: 1, + rtl: true + }); + $('.multiple-items-rtl').slick({ + dots: true, + infinite: true, + slidesToShow: 3, + slidesToScroll: 3, + rtl: true + }); + +}); +})(jQuery);
\ No newline at end of file |