$(function() { $('#services-tabs li a').click(function() { 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 - 80) }, 1000); return false; } } }); }); $(function() { $('#section4 a.more').click(function() { 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 - 80) }, 1000); return false; } } }); }); $(document).ready(function() { var mySwiper = new Swiper('.swiper-container',{ autoplay: '3000', loop: true }); $('.arrow-left').on('click', function(e){ e.preventDefault(); mySwiper.swipePrev(); }); $('.arrow-right').on('click', function(e){ e.preventDefault(); mySwiper.swipeNext(); }); }); $(window).load(function() { var InfiniteRotator = { init: function(selector) { var initialFadeIn = 1000; var itemInterval = 5000; var fadeTime = 2500; var numberOfItems = $(selector).length; var currentItem = 0; $(selector).eq(currentItem).fadeIn(initialFadeIn); var infiniteLoop = setInterval(function(){ $(selector).eq(currentItem).fadeOut(fadeTime); if(currentItem == numberOfItems -1){ currentItem = 0; }else{ currentItem++; } $(selector).eq(currentItem).fadeIn(fadeTime); }, itemInterval); } }; InfiniteRotator.init('.rotating0'); InfiniteRotator.init('.rotating1'); InfiniteRotator.init('.rotating2'); InfiniteRotator.init('.rotating3'); });