"use strict"; var lastScroll = 0; //check for browser os var isMobile = false; var isiPhoneiPad = false; if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { isMobile = true; } if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) { isiPhoneiPad = true; } //swiper button position in auto height slider function setButtonPosition() { if ($(window).width() > 767 && $(".swiper-auto-height-container").length > 0) { var leftPosition = parseInt($('.swiper-auto-height-container .swiper-slide').css('padding-left')); var bottomPosition = parseInt($('.swiper-auto-height-container .swiper-slide').css('padding-bottom')); var bannerWidth = parseInt($('.swiper-auto-height-container .slide-banner').outerWidth()); $('.navigation-area').css({'left': bannerWidth + leftPosition + 'px', 'bottom': bottomPosition + 'px'}); } else if ($(".swiper-auto-height-container").length > 0) { $('.navigation-area').css({'left': '', 'bottom': ''}); } } /*============================================================== parallax text - START CODE ==============================================================*/ function parallax_text() { var window_width = $(window).width(); if (window_width > 1024) { if ($('.swiper-auto-slide .swiper-slide').length !== 0) { $(document).on("mousemove", ".swiper-auto-slide .swiper-slide", function (e) { var positionX = e.clientX; var positionY = e.clientY; positionX = Math.round(positionX / 10) - 80; positionY = Math.round(positionY / 10) - 40; $(this).find('.parallax-text').css({'transform': 'translate(' + positionX + 'px,' + positionY + 'px)', 'transition-duration': '0s'}); }); $(document).on("mouseout", ".swiper-auto-slide .swiper-slide", function (e) { $('.parallax-text').css({'transform': 'translate(0,0)', 'transition-duration': '0.5s'}); }); } } } /*============================================================== //Parallax - START CODE ==============================================================*/ function stellarParallax() { if ($(window).width() > 1024) { $.stellar(); } else { $.stellar('destroy'); $('.parallax').css('background-position', ''); } } /*============================================================== full screen START CODE ==============================================================*/ function fullScreenHeight() { var element = $(".full-screen"); var $minheight = $(window).height(); element.parents('section').imagesLoaded(function () { if ($(".top-space .full-screen").length > 0) { var $headerheight = $("header nav.navbar").outerHeight(); $(".top-space .full-screen").css('min-height', $minheight - $headerheight); } else { element.css('min-height', $minheight); } }); var minwidth = $(window).width(); $(".full-screen-width").css('min-width', minwidth); var sidebarNavHeight = $('.sidebar-nav-style-1').height() - $('.logo-holder').parent().height() - $('.footer-holder').parent().height() - 10; $(".sidebar-nav-style-1 .nav").css('height', (sidebarNavHeight)); var style2NavHeight = parseInt($('.sidebar-part2').height() - parseInt($('.sidebar-part2 .sidebar-middle').css('padding-top')) - parseInt($('.sidebar-part2 .sidebar-middle').css('padding-bottom')) - parseInt($(".sidebar-part2 .sidebar-middle .sidebar-middle-menu .nav").css('margin-bottom'))); $(".sidebar-part2 .sidebar-middle .sidebar-middle-menu .nav").css('height', (style2NavHeight)); } function SetResizeContent() { // all function call SetMegamenuPosition(); setPageTitleSpace(); setButtonPosition(); parallax_text(); stellarParallax(); fullScreenHeight(); // navClick(); } /* =================================== START RESIZE ====================================== */ $(window).resize(function (event) { setTimeout(function () { SetResizeContent(); }, 500); $('.menu-back-div').each(function () { $(this).attr('style', ''); }); $('.navbar-collapse').collapse('hide'); event.preventDefault(); }); /* =================================== START READY ====================================== */ $(document).ready(function () { "use strict"; // Active class to current menu for only html var pgurl = window.location.href.substr(window.location.href.lastIndexOf("/") + 1); var $hash = window.location.hash.substring(1); if ($hash) { $hash = "#" + $hash; pgurl = pgurl.replace($hash, ""); } else { pgurl = pgurl.replace("#", ""); } $(".nav li a").each(function () { if ($(this).attr("href") == pgurl || $(this).attr("href") == pgurl + '.html') { $(this).parent().addClass("active"); $(this).parents('li.dropdown').addClass("active"); } }); $(window).scroll(function () { if ($(this).scrollTop() > 150) $('.scroll-top-arrow').fadeIn('slow'); else $('.scroll-top-arrow').fadeOut('slow'); }); //Click event to scroll to top $(document).on('click', '.scroll-top-arrow', function () { $('html, body').animate({scrollTop: 0}, 800); return false; }); /* =================================== swiper slider ====================================== */ var swiperFull = new Swiper('.swiper-full-screen', { loop: true, slidesPerView: 1, preventClicks: false, allowTouchMove: true, pagination: { el: '.swiper-full-screen-pagination', clickable: true }, autoplay: { delay: 5000 }, keyboard: { enabled: true }, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev' }, on: { resize: function () { swiperFull.update(); } } }); var swiperAutoFade = new Swiper('.swiper-auto-fade', { allowTouchMove: true, loop: true, slidesPerView: 1, preventClicks: false, effect: 'fade', autoplay: { delay: 5000 }, keyboard: { enabled: true }, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev' }, pagination: { el: '.swiper-auto-pagination', clickable: true }, on: { resize: function () { swiperAutoFade.update(); } } }); var swiperSecond = new Swiper('.swiper-slider-second', { allowTouchMove: true, slidesPerView: 1, preventClicks: false, keyboard: { enabled: true }, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev' }, pagination: { el: '.swiper-pagination-second', clickable: true }, on: { resize: function () { swiperSecond.update(); } } }); var swiperThird = new Swiper('.swiper-slider-third', { allowTouchMove: true, slidesPerView: 1, preventClicks: false, keyboard: { enabled: true }, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev' }, pagination: { el: '.swiper-pagination-third', clickable: true }, on: { resize: function () { swiperThird.update(); } } }); var swiperNumber = new Swiper('.swiper-number-pagination', { allowTouchMove: true, preventClicks: false, autoplay: { delay: 4000, disableOnInteraction: true }, pagination: { el: '.swiper-number', clickable: true, renderBullet: function (index, className) { return '' + pad((index + 1)) + ''; } }, on: { resize: function () { swiperNumber.update(); } } }); var swiperVerticalPagination = new Swiper('.swiper-vertical-pagination', { allowTouchMove: true, direction: 'vertical', slidesPerView: 1, spaceBetween: 0, preventClicks: false, mousewheel: { mousewheel: true, sensitivity: 1, releaseOnEdges: true }, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev' }, pagination: { el: '.swiper-pagination-vertical', clickable: true }, on: { resize: function () { swiperVerticalPagination.update(); } } }); var swiperClients = new Swiper('.swiper-slider-clients', { allowTouchMove: true, slidesPerView: 4, paginationClickable: true, preventClicks: true, autoplay: { delay: 3000, disableOnInteraction: true }, pagination: { el: null }, breakpoints: { 1199: { slidesPerView: 3 }, 991: { slidesPerView: 2 }, 767: { slidesPerView: 1 } }, on: { resize: function () { swiperClients.update(); } } }); var swiperClients2 = new Swiper('.swiper-slider-clients-second', { allowTouchMove: true, slidesPerView: 4, paginationClickable: true, preventClicks: true, autoplay: { delay: 3000, disableOnInteraction: true }, pagination: { el: null }, breakpoints: { 1199: { slidesPerView: 3 }, 991: { slidesPerView: 2 }, 767: { slidesPerView: 1 } }, on: { resize: function () { swiperClients2.update(); } } }); var swiperThreeSlides = new Swiper('.swiper-three-slides', { allowTouchMove: true, slidesPerView: 3, preventClicks: false, pagination: { el: '.swiper-pagination-three-slides', clickable: true }, autoplay: { delay: 3000 }, keyboard: { enabled: true }, navigation: { nextEl: '.swiper-three-slide-next', prevEl: '.swiper-three-slide-prev' }, breakpoints: { 991: { slidesPerView: 2 }, 767: { slidesPerView: 1 } }, on: { resize: function () { swiperThreeSlides.update(); } } }); var swiperFourSlides = new Swiper('.swiper-four-slides', { allowTouchMove: true, slidesPerView: 4, preventClicks: false, pagination: { el: '.swiper-pagination-four-slides', clickable: true }, autoplay: { delay: 3000 }, keyboard: { enabled: true }, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev' }, breakpoints: { 1199: { slidesPerView: 3 }, 991: { slidesPerView: 2 }, 767: { slidesPerView: 1 } }, on: { resize: function () { swiperFourSlides.update(); } } }); var swiperDemoHeaderStyle = new Swiper('.swiper-demo-header-style', { allowTouchMove: true, loop: true, slidesPerView: 4, preventClicks: true, slidesPerGroup: 4, pagination: { el: '.swiper-pagination-demo-header-style', clickable: true }, autoplay: { delay: 3000 }, keyboard: { enabled: true }, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev' }, breakpoints: { 1199: { slidesPerGroup: 2, slidesPerView: 2 }, 767: { slidesPerGroup: 1, slidesPerView: 1 } }, on: { resize: function () { swiperDemoHeaderStyle.update(); } } }); var $swiperAutoSlideIndex = 0; var swiperAutoSlide = new Swiper('.swiper-auto-slide', { allowTouchMove: true, slidesPerView: 'auto', centeredSlides: true, spaceBetween: 80, preventClicks: false, observer: true, speed: 1000, pagination: { el: null }, scrollbar: { el: '.swiper-scrollbar', draggable: true, hide: false, snapOnRelease: true }, autoplay: { delay: 3000 }, mousewheel: { invert: false }, keyboard: { enabled: true }, navigation: { nextEl: '.swiper-next-style2', prevEl: '.swiper-prev-style2' }, breakpoints: { 1199: { spaceBetween: 60 }, 960: { spaceBetween: 30 }, 767: { spaceBetween: 15 } }, on: { resize: function () { swiperAutoSlide.update(); } } }); if ($(window).width() > 767) { var swiperBottomScrollbarFull = new Swiper('.swiper-bottom-scrollbar-full', { allowTouchMove: true, slidesPerView: 'auto', grabCursor: true, preventClicks: false, spaceBetween: 30, keyboardControl: true, speed: 1000, pagination: { el: null }, scrollbar: { el: '.swiper-scrollbar', draggable: true, hide: false, snapOnRelease: true }, mousewheel: { enable: true }, keyboard: { enabled: true }, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev' } }); } var swiperAutoHieght = new Swiper('.swiper-auto-height-container', { allowTouchMove: true, effect: 'fade', loop: true, autoHeight: true, pagination: { el: '.swiper-auto-height-pagination', clickable: true }, autoplay: { delay: 3000 }, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev' }, on: { resize: function () { swiperAutoHieght.update(); } } }); var swiperMultyRow = new Swiper('.swiper-multy-row-container', { allowTouchMove: true, slidesPerView: 4, spaceBetween: 15, pagination: { el: '.swiper-multy-row-pagination', clickable: true }, autoplay: { delay: 3000, disableOnInteraction: true }, navigation: { nextEl: '.swiper-portfolio-next', prevEl: '.swiper-portfolio-prev' }, breakpoints: { 991: { slidesPerView: 2 }, 767: { slidesPerView: 1 } }, on: { resize: function () { swiperMultyRow.update(); } } }); var swiperBlog = new Swiper('.swiper-blog', { allowTouchMove: true, slidesPerView: "auto", centeredSlides: true, spaceBetween: 15, preventClicks: false, loop: true, loopedSlides: 3, pagination: { el: '.swiper-blog-pagination', clickable: true }, autoplay: { delay: 5000, disableOnInteraction: true }, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev' }, on: { resize: function () { swiperBlog.update(); } } }); var swiperPresentation = new Swiper('.swiper-presentation', { allowTouchMove: true, slidesPerView: 4, centeredSlides: true, spaceBetween: 30, preventClicks: true, loop: true, loopedSlides: 6, pagination: { el: '.swiper-presentation-pagination', clickable: true }, autoplay: { delay: 3000, disableOnInteraction: true }, keyboard: { enabled: true }, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev' }, breakpoints: { 991: { spaceBetween: 15, slidesPerView: 2 }, 767: { slidesPerView: 1 } }, on: { resize: function () { swiperPresentation.update(); } } }); var resizeId; $(window).resize(function () { if ($(".swiper-auto-slide").length > 0 && swiperAutoSlide) { $swiperAutoSlideIndex = swiperAutoSlide.activeIndex; swiperAutoSlide.detachEvents(); swiperAutoSlide.destroy(true, false); swiperAutoSlide = undefined; $(".swiper-auto-slide .swiper-wrapper").css("transform", "").css("transition-duration", ""); $(".swiper-auto-slide .swiper-slide").css("margin-right", ""); setTimeout(function () { swiperAutoSlide = new Swiper('.swiper-auto-slide', { allowTouchMove: true, slidesPerView: 'auto', centeredSlides: true, spaceBetween: 80, preventClicks: false, mousewheelControl: true, observer: true, speed: 1000, pagination: { el: null }, scrollbar: { el: '.swiper-scrollbar', draggable: true, hide: false, snapOnRelease: true }, autoplay: { delay: 3000 }, keyboard: { enabled: true }, navigation: { nextEl: '.swiper-next-style2', prevEl: '.swiper-prev-style2' }, breakpoints: { 1199: { spaceBetween: 60 }, 960: { spaceBetween: 30 }, 767: { spaceBetween: 15 } }, on: { resize: function () { swiperAutoSlide.update(); } } }); swiperAutoSlide.slideTo($swiperAutoSlideIndex, 1000, false); }, 1000); } if ($(".swiper-bottom-scrollbar-full").length > 0) { clearTimeout(resizeId); resizeId = setTimeout(doneResizing, 1000); } /* update all swiper on window resize */ setTimeout(function () { if ($('.swiper-full-screen').length > 0 && swiperFull) { swiperFull.update(); } if ($('.swiper-auto-fade').length > 0 && swiperAutoFade) { swiperAutoFade.update(); } if ($('.swiper-slider-second').length > 0 && swiperSecond) { swiperSecond.update(); } if ($('.swiper-slider-third').length > 0 && swiperThird) { swiperThird.update(); } if ($('.swiper-number-pagination').length > 0 && swiperNumber) { swiperNumber.update(); } if ($('.swiper-vertical-pagination').length > 0 && swiperVerticalPagination) { swiperVerticalPagination.update(); } if ($('.swiper-slider-clients').length > 0 && swiperClients) { swiperClients.update(); } if ($('.swiper-slider-clients-second').length > 0 && swiperClients2) { swiperClients2.update(); } if ($('.swiper-three-slides').length > 0 && swiperThreeSlides) { swiperThreeSlides.update(); } if ($('.swiper-four-slides').length > 0 && swiperFourSlides) { swiperFourSlides.update(); } if ($('.swiper-demo-header-style').length > 0 && swiperDemoHeaderStyle) { swiperDemoHeaderStyle.update(); } if ($('.swiper-auto-slide').length > 0 && swiperAutoSlide) { swiperAutoSlide.update(); } if ($('.swiper-auto-height-container').length > 0 && swiperAutoHieght) { swiperAutoHieght.update(); } if ($('.swiper-multy-row-container').length > 0 && swiperMultyRow) { swiperMultyRow.update(); } if ($('.swiper-blog').length > 0 && swiperBlog) { swiperBlog.update(); } if ($('.swiper-presentation').length > 0 && swiperPresentation) { swiperPresentation.update(); } }, 500); if (isIE()) { setTimeout(function () { if ($('.swiper-full-screen').length > 0 && swiperFull) { swiperFull.update(); } if ($('.swiper-auto-fade').length > 0 && swiperAutoFade) { swiperAutoFade.update(); } if ($('.swiper-slider-second').length > 0 && swiperSecond) { swiperSecond.update(); } if ($('.swiper-slider-third').length > 0 && swiperThird) { swiperThird.update(); } if ($('.swiper-number-pagination').length > 0 && swiperNumber) { swiperNumber.update(); } if ($('.swiper-vertical-pagination').length > 0 && swiperVerticalPagination) { swiperVerticalPagination.update(); } if ($('.swiper-slider-clients').length > 0 && swiperClients) { swiperClients.update(); } if ($('.swiper-slider-clients-second').length > 0 && swiperClients2) { swiperClients2.update(); } if ($('.swiper-three-slides').length > 0 && swiperThreeSlides) { swiperThreeSlides.update(); } if ($('.swiper-four-slides').length > 0 && swiperFourSlides) { swiperFourSlides.update(); } if ($('.swiper-demo-header-style').length > 0 && swiperDemoHeaderStyle) { swiperDemoHeaderStyle.update(); } if ($('.swiper-auto-slide').length > 0 && swiperAutoSlide) { swiperAutoSlide.update(); } if ($('.swiper-auto-height-container').length > 0 && swiperAutoHieght) { swiperAutoHieght.update(); } if ($('.swiper-multy-row-container').length > 0 && swiperMultyRow) { swiperMultyRow.update(); } if ($('.swiper-blog').length > 0 && swiperBlog) { swiperBlog.update(); } if ($('.swiper-presentation').length > 0 && swiperPresentation) { swiperPresentation.update(); } }, 500); } }); function doneResizing() { if (swiperBottomScrollbarFull) { swiperBottomScrollbarFull.detachEvents(); swiperBottomScrollbarFull.destroy(true, true); swiperBottomScrollbarFull = undefined; } $(".swiper-bottom-scrollbar-full .swiper-wrapper").css("transform", "").css("transition-duration", ""); $(".swiper-bottom-scrollbar-full .swiper-slide").css("margin-right", ""); $('.swiper-bottom-scrollbar-full .swiper-wrapper').removeAttr('style'); $('.swiper-bottom-scrollbar-full .swiper-slide').removeAttr('style'); if ($(window).width() > 767) { setTimeout(function () { swiperBottomScrollbarFull = new Swiper('.swiper-bottom-scrollbar-full', { allowTouchMove: true, slidesPerView: 'auto', grabCursor: true, preventClicks: false, spaceBetween: 30, keyboardControl: true, speed: 1000, pagination: { el: null }, scrollbar: { el: '.swiper-scrollbar', draggable: true, hide: false, snapOnRelease: true }, mousewheel: { enable: true }, keyboard: { enabled: true }, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev' } }); }, 500); } } /*============================================================== smooth scroll ==============================================================*/ var scrollAnimationTime = 1200, scrollAnimation = 'easeInOutExpo'; $(document).on('click.smoothscroll', 'a.scrollto', function (event) { event.preventDefault(); var target = this.hash; if ($(target).length != 0) { $('html, body').stop() .animate({ 'scrollTop': $(target) .offset() .top }, scrollAnimationTime, scrollAnimation, function () { window.location.hash = target; }); } }); /*============================================================== portfolio filter ==============================================================*/ var $portfolio_filter = $('.portfolio-grid'); $portfolio_filter.imagesLoaded(function () { $portfolio_filter.isotope({ layoutMode: 'masonry', itemSelector: '.grid-item', percentPosition: true, masonry: { columnWidth: '.grid-sizer' } }); $portfolio_filter.isotope(); }); // Default filter selector start code var $active_grid_selector = $('.portfolio-filter > li.active > a'); var selector = $active_grid_selector.attr('data-filter'); $portfolio_filter.find('.grid-item').removeClass('animated').css("visibility", ""); // avoid problem to filter after sorting $portfolio_filter.isotope({filter: selector}); // Default filter selector end code var $grid_selectors = $('.portfolio-filter > li > a'); $grid_selectors.on('click', function () { $grid_selectors.parent().removeClass('active'); $(this).parent().addClass('active'); var selector = $(this).attr('data-filter'); $portfolio_filter.find('.grid-item').removeClass('animated').css("visibility", ""); // avoid problem to filter after sorting $portfolio_filter.find('.grid-item').each(function () { /* remove perticular element from WOW array when you don't want animation on element after DOM lead */ wow.removeBox(this); $(this).css("-webkit-animation", "none"); $(this).css("-moz-animation", "none"); $(this).css("-ms-animation", "none"); $(this).css("animation", "none"); }); $portfolio_filter.isotope({filter: selector}); return false; }); $(window).resize(function () { if (!isMobile && !isiPhoneiPad) { $portfolio_filter.imagesLoaded(function () { setTimeout(function () { $portfolio_filter.find('.grid-item').removeClass('wow').removeClass('animated'); // avoid problem to filter after window resize $portfolio_filter.isotope('layout'); }, 300); }); } }); var $blog_filter = $('.blog-grid'); $blog_filter.imagesLoaded(function () { $blog_filter.isotope({ layoutMode: 'masonry', itemSelector: '.grid-item', percentPosition: true, masonry: { columnWidth: '.grid-sizer' } }); }); $(window).resize(function () { setTimeout(function () { $blog_filter.find('.grid-item').removeClass('wow').removeClass('animated'); // avoid problem to filter after window resize $blog_filter.isotope('layout'); }, 300); }); //blog page header animation $(".blog-header-style1 li").hover(function () { $('.blog-header-style1 li.blog-column-active').removeClass('blog-column-active'); $(this).addClass('blog-column-active'); }, function () { $(this).removeClass('blog-column-active'); $('.blog-header-style1 li:first-child').addClass('blog-column-active'); }); /*==============================================================*/ //big menu open close start /*==============================================================*/ $('.big-menu-open').on("click", function () { $('.big-menu-right').addClass("open"); }); $('.big-menu-close').on("click", function () { $('.big-menu-right').removeClass("open"); }); /*==============================================================*/ //accordion - START CODE /*==============================================================*/ $('.accordion-style1 .collapse').on('show.bs.collapse', function () { var id = $(this).attr('id'); $('a[href="#' + id + '"]').closest('.panel-heading').addClass('active-accordion'); $('a[href="#' + id + '"] .panel-title span').html(''); }); $('.accordion-style1 .collapse').on('hide.bs.collapse', function () { var id = $(this).attr('id'); $('a[href="#' + id + '"]').closest('.panel-heading').removeClass('active-accordion'); $('a[href="#' + id + '"] .panel-title span').html(''); }); $(document).on('click', '.nav.navbar-nav a.inner-link', function (e) { $(this).parents('ul.navbar-nav').find('a.inner-link').removeClass('active'); var $this = $(this); $(this).parents('.navbar-collapse').collapse('hide'); setTimeout(function () { $this.addClass('active'); }, 1000); }); $('.accordion-style2 .collapse').on('show.bs.collapse', function () { var id = $(this).attr('id'); $('a[href="#' + id + '"]').closest('.panel-heading').addClass('active-accordion'); $('a[href="#' + id + '"] .panel-title').find('i').addClass('fa-angle-up').removeClass('fa-angle-down'); }); $('.accordion-style2 .collapse').on('hide.bs.collapse', function () { var id = $(this).attr('id'); $('a[href="#' + id + '"]').closest('.panel-heading').removeClass('active-accordion'); $('a[href="#' + id + '"] .panel-title').find('i').removeClass('fa-angle-up').addClass('fa-angle-down'); }); $('.accordion-style3 .collapse').on('show.bs.collapse', function () { var id = $(this).attr('id'); $('a[href="#' + id + '"]').closest('.panel-heading').addClass('active-accordion'); $('a[href="#' + id + '"] .panel-title').find('i').addClass('fa-angle-up').removeClass('fa-angle-down'); }); $('.accordion-style3 .collapse').on('hide.bs.collapse', function () { var id = $(this).attr('id'); $('a[href="#' + id + '"]').closest('.panel-heading').removeClass('active-accordion'); $('a[href="#' + id + '"] .panel-title').find('i').removeClass('fa-angle-up').addClass('fa-angle-down'); }); /*==============================================================*/ //toggles - START CODE /*==============================================================*/ $('.toggles .collapse').on('show.bs.collapse', function () { var id = $(this).attr('id'); $('a[href="#' + id + '"]').closest('.panel-heading').addClass('active-accordion'); $('a[href="#' + id + '"] .panel-title span').html(''); }); $('.toggles .collapse').on('hide.bs.collapse', function () { var id = $(this).attr('id'); $('a[href="#' + id + '"]').closest('.panel-heading').removeClass('active-accordion'); $('a[href="#' + id + '"] .panel-title span').html(''); }); $('.toggles-style2 .collapse').on('show.bs.collapse', function () { var id = $(this).attr('id'); $('a[href="#' + id + '"]').closest('.panel-heading').addClass('active-accordion'); $('a[href="#' + id + '"] .panel-title span').html(''); }); $('.toggles-style2 .collapse').on('hide.bs.collapse', function () { var id = $(this).attr('id'); $('a[href="#' + id + '"]').closest('.panel-heading').removeClass('active-accordion'); $('a[href="#' + id + '"] .panel-title span').html(''); }); /* =================================== blog hover box ====================================== */ $(document).on("mouseenter", ".blog-post-style4 .grid-item", function (e) { $(this).find("figcaption .blog-hover-text").slideDown(300); }); $(document).on("mouseleave", ".blog-post-style4 .grid-item", function (e) { $(this).find("figcaption .blog-hover-text").slideUp(300); }); SetResizeContent(); var $allNonRatinaImages = $("img:not([data-rjs])"); $allNonRatinaImages.attr('data-no-retina', ''); /*==============================================================*/ //demo button - START CODE /*==============================================================*/ var $buythemediv = '
Buy Theme
Quick Question?
'; $('body').append($buythemediv); $(document).on("touchstart", ".sidebar-wrapper", function () { clearOpen(); }); var getNav = $("nav.navbar.bootsnav"), getIn = getNav.find("ul.nav").data("in"), getOut = getNav.find("ul.nav").data("out"); function clearOpen() { $('li.dropdown').removeClass("on").removeClass("show"); $(".dropdown-menu").stop().fadeOut('fast'); $(".dropdown-menu").removeClass(getIn); $(".dropdown-menu").addClass(getOut); } }); /* =================================== END READY ====================================== */ /* =================================== START Page Load ====================================== */ $(document).on('load', function () { var hash = window.location.hash.substr(1); if (hash != "") { setTimeout(function () { $(document).imagesLoaded(function () { var scrollAnimationTime = 1200, scrollAnimation = 'easeInOutExpo'; var target = '#' + hash; if ($(target).length > 0) { $('html, body').stop() .animate({ 'scrollTop': $(target).offset().top }, scrollAnimationTime, scrollAnimation, function () { window.location.hash = target; }); } }); }, 500); } fullScreenHeight(); });