diff options
author | Themefisher Dev <themefisher.dev@gmail.com> | 2020-02-08 12:58:57 +0300 |
---|---|---|
committer | Themefisher Dev <themefisher.dev@gmail.com> | 2020-02-08 12:58:57 +0300 |
commit | b5e577427fb217d5823ac45898541f353e4aeb4d (patch) | |
tree | d36409c1f7b1e25850a8cc5fdc053666fb18cca8 | |
parent | 40588199b1253be3bb2ff71000e0e308df45ef6b (diff) |
modified script.js file
-rw-r--r-- | assets/script.js | 93 |
1 files changed, 37 insertions, 56 deletions
diff --git a/assets/script.js b/assets/script.js index 1c29267..1491cf8 100644 --- a/assets/script.js +++ b/assets/script.js @@ -1,63 +1,44 @@ $(window).load(function () { - $("#preloader-wrapper").fadeOut("slow"); + $("#preloader-wrapper").fadeOut("slow"); }); $(document).ready(function () { - - - //animated header class - $(window).scroll(function () { - var scroll = $(window).scrollTop(); - //console.log(scroll); - if (scroll > 200) { - //console.log('a'); - $(".navigation").addClass("animated"); - } else { - //console.log('a'); - $(".navigation").removeClass("animated"); - } - }); - - - - $(".gallery-slider").owlCarousel({ - pagination: true, - autoPlay: 5000, - itemsDesktop: [1500, 4], - itemsDesktopSmall: [979, 3] - }); - - // Gallery Popup - $('.image-popup').magnificPopup({ - type: 'image' - }); - - - - // animation scroll js - var html_body = $('html, body'); - $('.page-scroll').on('click', function () { //use page-scroll class in any HTML tag for scrolling - if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) { - var target = $(this.hash); - target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); - if (target.length) { - html_body.animate({ - scrollTop: target.offset().top - 90 - }, 1500, "easeInOutExpo"); - return false; - } - } - }); - - // easeInOutExpo Declaration - jQuery.extend(jQuery.easing, { - easeInOutExpo: function (x, t, b, c, d) { - if (t == 0) return b; - if (t == d) return b + c; - if ((t /= d / 2) < 1) return c / 2 * Math.pow(2, 10 * (t - 1)) + b; - return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b; - } - }); + $(".gallery-slider").owlCarousel({ + pagination: true, + autoPlay: 5000, + itemsDesktop: [1500, 4], + itemsDesktopSmall: [979, 3] + }); + + // Gallery Popup + $('.image-popup').magnificPopup({ + type: 'image' + }); + + // animation scroll js + var html_body = $('html, body'); + $('.page-scroll').on('click', function () { //use page-scroll class in any HTML tag for scrolling + if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) { + var target = $(this.hash); + target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); + if (target.length) { + html_body.animate({ + scrollTop: target.offset().top - 0 + }, 1500, "easeInOutExpo"); + return false; + } + } + }); + + // easeInOutExpo Declaration + jQuery.extend(jQuery.easing, { + easeInOutExpo: function (x, t, b, c, d) { + if (t == 0) return b; + if (t == d) return b + c; + if ((t /= d / 2) < 1) return c / 2 * Math.pow(2, 10 * (t - 1)) + b; + return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b; + } + }); });
\ No newline at end of file |