// JavaScript Document $(window).on('load', function() { "use strict"; /*----------------------------------------------------*/ /* Preloader /*----------------------------------------------------*/ var preloader = $('#loader-wrapper'), loader = preloader.find('.loader-inner'); loader.fadeOut(); preloader.delay(400).fadeOut('slow'); $(window).stellar({}); }); $(document).ready(function() { "use strict"; /*----------------------------------------------------*/ /* ScrollUp /*----------------------------------------------------*/ $.scrollUp = function (options) { // Defaults var defaults = { scrollName: 'scrollUp', // Element ID topDistance: 600, // Distance from top before showing element (px) topSpeed: 800, // Speed back to top (ms) animation: 'fade', // Fade, slide, none animationInSpeed: 200, // Animation in speed (ms) animationOutSpeed: 200, // Animation out speed (ms) scrollText: '', // Text for element scrollImg: false, // Set true to use image activeOverlay: false // Set CSS color to display scrollUp active point, e.g '#00FFFF' }; var o = $.extend({}, defaults, options), scrollId = '#' + o.scrollName; // Create element $('', { id: o.scrollName, href: '#top', title: o.scrollText }).appendTo('body'); // If not using an image display text if (!o.scrollImg) { $(scrollId).text(o.scrollText); } // Minium CSS to make the magic happen $(scrollId).css({'display':'none','position': 'fixed','z-index': '2147483647'}); // Active point overlay if (o.activeOverlay) { $("body").append("
"); $(scrollId+"-active").css({ 'position': 'absolute', 'top': o.topDistance+'px', 'width': '100%', 'border-top': '1px dotted '+o.activeOverlay, 'z-index': '2147483647' }); } // Scroll function $(window).on('scroll', function(){ switch (o.animation) { case "fade": $( ($(window).scrollTop() > o.topDistance) ? $(scrollId).fadeIn(o.animationInSpeed) : $(scrollId).fadeOut(o.animationOutSpeed) ); break; case "slide": $( ($(window).scrollTop() > o.topDistance) ? $(scrollId).slideDown(o.animationInSpeed) : $(scrollId).slideUp(o.animationOutSpeed) ); break; default: $( ($(window).scrollTop() > o.topDistance) ? $(scrollId).show(0) : $(scrollId).hide(0) ); } }); // To the top $(scrollId).on('click', function(event){ $('html, body').animate({scrollTop:0}, o.topSpeed); event.preventDefault(); }); }; $.scrollUp(); /*----------------------------------------------------*/ /* Services Rotator /*----------------------------------------------------*/ var owl = $('.ipages-holder'); owl.owlCarousel({ items: 4, loop:true, autoplay:true, navBy: 1, autoplayTimeout: 4500, autoplayHoverPause: false, smartSpeed: 1500, responsive:{ 0:{ items:1 }, 767:{ items:2 }, 768:{ items:3 }, 991:{ items:3 }, 1000:{ items:3 }, 1441:{ items:4 } } }); });