/*-----------------------------------------------------------------------------------*/ /* OWL CAROUSEL /*-----------------------------------------------------------------------------------*/ $ = jQuery; $(document).ready(function () { $(".owlcarousel").owlCarousel({ navigation: true, navigationText : ['',''], pagination: false, rewindNav: false, items: 3, mouseDrag: true, itemsDesktop: [1200, 3], itemsDesktopSmall: [1024, 3], itemsTablet: [970, 2], itemsMobile: [767, 1] }); $(".owl-clients").owlCarousel({ autoPlay: 9000, rewindNav: false, items: 6, itemsDesktop: [1200, 6], itemsDesktopSmall: [1024, 4], itemsTablet: [768, 3], itemsMobile: [480, 2], navigation: false, pagination: false }); var owl = $(".owl-portfolio-slider"); owl.owlCarousel({ navigation: false, autoHeight: true, slideSpeed: 300, paginationSpeed: 400, singleItem: true }); // Custom Navigation Events $(".slider-next").click(function () { owl.trigger('owl.next'); }) $(".slider-prev").click(function () { owl.trigger('owl.prev'); }) }); /*-----------------------------------------------------------------------------------*/ /* TABS /*-----------------------------------------------------------------------------------*/ $(document).ready(function () { $('.tabs.services').easytabs({ animationSpeed: 300, updateHash: false, cycle: 5000 }); }); $(document).ready(function () { $('.tabs.tabs-top, .tabs.tabs-side').easytabs({ animationSpeed: 300, updateHash: false }); }); /*-----------------------------------------------------------------------------------*/ /* TESTIMONIALS /*-----------------------------------------------------------------------------------*/ $(document).ready(function () { $('#testimonials').easytabs({ animationSpeed: 500, updateHash: false, cycle: 5000 }); }); /*-----------------------------------------------------------------------------------*/ /* GO TO TOP /*-----------------------------------------------------------------------------------*/ ! function (a, b, c) { a.fn.scrollUp = function (b) { a.data(c.body, "scrollUp") || (a.data(c.body, "scrollUp", !0), a.fn.scrollUp.init(b)) }, a.fn.scrollUp.init = function (d) { var e = a.fn.scrollUp.settings = a.extend({}, a.fn.scrollUp.defaults, d), f = e.scrollTitle ? e.scrollTitle : e.scrollText, g = a("", { id: e.scrollName, href: "#top", title: f }).appendTo("body"); e.scrollImg || g.html(e.scrollText), g.css({ display: "none", position: "fixed", zIndex: e.zIndex }), e.activeOverlay && a("
", { id: e.scrollName + "-active" }).css({ position: "absolute", top: e.scrollDistance + "px", width: "100%", borderTop: "1px dotted" + e.activeOverlay, zIndex: e.zIndex }).appendTo("body"), scrollEvent = a(b).scroll(function () { switch (scrollDis = "top" === e.scrollFrom ? e.scrollDistance : a(c).height() - a(b).height() - e.scrollDistance, e.animation) { case "fade": a(a(b).scrollTop() > scrollDis ? g.fadeIn(e.animationInSpeed) : g.fadeOut(e.animationOutSpeed)); break; case "slide": a(a(b).scrollTop() > scrollDis ? g.slideDown(e.animationInSpeed) : g.slideUp(e.animationOutSpeed)); break; default: a(a(b).scrollTop() > scrollDis ? g.show(0) : g.hide(0)) } }), g.click(function (b) { b.preventDefault(), a("html, body").animate({ scrollTop: 0 }, e.topSpeed, e.easingType) }) }, a.fn.scrollUp.defaults = { scrollName: "scrollUp", scrollDistance: 300, scrollFrom: "top", scrollSpeed: 300, easingType: "linear", animation: "fade", animationInSpeed: 200, animationOutSpeed: 200, scrollText: "Scroll to top", scrollTitle: !1, scrollImg: !1, activeOverlay: !1, zIndex: 2147483647 }, a.fn.scrollUp.destroy = function (d) { a.removeData(c.body, "scrollUp"), a("#" + a.fn.scrollUp.settings.scrollName).remove(), a("#" + a.fn.scrollUp.settings.scrollName + "-active").remove(), a.fn.jquery.split(".")[1] >= 7 ? a(b).off("scroll", d) : a(b).unbind("scroll", d) }, a.scrollUp = a.fn.scrollUp }(jQuery, window, document); $(document).ready(function () { $.scrollUp({ scrollName: 'scrollUp', // Element ID scrollDistance: 300, // Distance from top/bottom before showing element (px) scrollFrom: 'top', // 'top' or 'bottom' scrollSpeed: 300, // Speed back to top (ms) easingType: 'linear', // Scroll to top easing (see http://easings.net/) animation: 'fade', // Fade, slide, none animationInSpeed: 200, // Animation in speed (ms) animationOutSpeed: 200, // Animation out speed (ms) scrollText: '', // Text for element, can contain HTML scrollTitle: false, // Set a custom title if required. Defaults to scrollText scrollImg: false, // Set true to use image activeOverlay: false, // Set CSS color to display scrollUp active point, e.g '#00FFFF' zIndex: 1001 // Z-Index for the overlay }); }); /*-----------------------------------------------------------------------------------*/ /* MENU /*-----------------------------------------------------------------------------------*/ $(document).ready(function () { $('.js-activated').dropdownHover({ instantlyCloseOthers: false, delay: 0 }).dropdown(); $('.dropdown-menu a, .social .dropdown-menu, .social .dropdown-menu input').click(function (e) { e.stopPropagation(); }); /* * JQ function to detect if .main-navigation dropdown navigation would go off screen and reposition it */ $(".main-navigation li").on('mouseenter mouseleave', function (e) { // detect li mouseenter & mouseleave events //console.log($('ul:first', this).offset()); if ($('ul', this).length >= 1) { // check whether li pops a ul or ul(s) var elm = $('ul:first', this); var off = elm.offset(); var l = off.left; // get distance of ul from the left edge of browser container var w = elm.width(); // get width of ul var docH = $(".container").height(); // get height of browser container var docW = $(".container").width(); // get width of browser container var fit = (l + w); isEntirelyVisible = (fit <= docW); // confirm whether ul element is entirely visible on the browser container if (!isEntirelyVisible) { // add and remove .pull-left appropriately $(this).addClass('pull-left'); } else { $(this).removeClass('pull-left'); } }; }); }); /*-----------------------------------------------------------------------------------*/ /* ISOTOPE PORTFOLIO /*-----------------------------------------------------------------------------------*/ $(document).ready(function () { var $container = $('.items'); $container.imagesLoaded(function () { $container.isotope({ itemSelector: '.item', layoutMode: 'fitRows' }); }); $('.portfolio .filter li a').click(function () { $('.portfolio .filter li a').removeClass('active'); $(this).addClass('active'); var selector = $(this).attr('data-filter'); $container.isotope({ filter: selector }); return false; }); }); /*-----------------------------------------------------------------------------------*/ /* ISOTOPE GRID BLOG /*-----------------------------------------------------------------------------------*/ $(document).ready(function () { var $container = $('.grid-blog'); $container.imagesLoaded(function () { $container.isotope({ itemSelector: '.post' }); }); $(window).on('resize', function () { $('.grid-blog').isotope('reLayout') }); }); /*-----------------------------------------------------------------------------------*/ /* ISOTOPE LATEST BLOG /*-----------------------------------------------------------------------------------*/ $(document).ready(function () { var $container = $('.latest-blog'); $container.imagesLoaded(function () { $container.isotope({ itemSelector: '.post', layoutMode: 'fitRows' }); }); $(window).on('resize', function () { $('.latest-blog').isotope('reLayout') }); }); /*-----------------------------------------------------------------------------------*/ /* IMAGE HOVER /*-----------------------------------------------------------------------------------*/ $(document).ready(function () { $('.icon-overlay a').prepend(''); /* '' */ }); /*-----------------------------------------------------------------------------------*/ /* PRETTIFY /*-----------------------------------------------------------------------------------*/ jQuery(document).ready(function () { window.prettyPrint && prettyPrint() }); /*-----------------------------------------------------------------------------------*/ /* DATA REL /*-----------------------------------------------------------------------------------*/ $('a[data-rel]').each(function () { $(this).attr('rel', $(this).data('rel')); }); /*-----------------------------------------------------------------------------------*/ /* VIDEO /*-----------------------------------------------------------------------------------*/ jQuery(document).ready(function () { jQuery('.player').fitVids(); }); /*-----------------------------------------------------------------------------------*/ /* FORM /*-----------------------------------------------------------------------------------*/ jQuery(document).ready(function ($) { $('.forms').dcSlickForms(); }); $(document).ready(function () { $('.comment-form input[title], .comment-form textarea').each(function () { if ($(this).val() === '') { $(this).val($(this).attr('title')); } $(this).focus(function () { if ($(this).val() == $(this).attr('title')) { $(this).val('').addClass('focused'); } }); $(this).blur(function () { if ($(this).val() === '') { $(this).val($(this).attr('title')).removeClass('focused'); } }); }); }); /*-----------------------------------------------------------------------------------*/ /* PARALLAX MOBILE /*-----------------------------------------------------------------------------------*/ $(document).ready(function () { if (navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/BlackBerry/i)) { $('.parallax').addClass('mobile'); } }); /*-----------------------------------------------------------------------------------*/ /* TOOLTIP /*-----------------------------------------------------------------------------------*/ $(document).ready(function () { if ($("[rel=tooltip]").length) { $("[rel=tooltip]").tooltip(); } }); /*-----------------------------------------------------------------------------------*/ /* STICKY NAVIGATION /*-----------------------------------------------------------------------------------*/ $(document).ready(function () { var menu = $('.navbar'), pos = menu.offset(); $(window).scroll(function () { if ($(this).scrollTop() > pos.top + menu.height() && menu.hasClass('default') && $(this).scrollTop() > 150) { menu.fadeOut('fast', function () { $(this).removeClass('default').addClass('fixed').fadeIn('fast'); }); } else if ($(this).scrollTop() <= pos.top + 150 && menu.hasClass('fixed')) { menu.fadeOut(0, function () { $(this).removeClass('fixed').addClass('default').fadeIn(0); }); } }); }); $(document).ready(function() { $('.offset').css('padding-top', $('.navbar').height() + 'px'); }); $(window).resize(function() { $('.offset').css('padding-top', $('.navbar').height() + 'px'); }); /*-----------------------------------------------------------------------------------*/ /* ONEPAGE ANCHOR SCROLL /*-----------------------------------------------------------------------------------*/ /** * jQuery.LocalScroll - Animated scrolling navigation, using anchors. * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com * Dual licensed under MIT and GPL. * Date: 3/11/2009 * @author Ariel Flesler * @version 1.2.7 **/ (function($){var l=location.href.replace(/#.*/,'');var g=$.localScroll=function(a){$('body').localScroll(a)};g.defaults={duration:1e3,axis:'y',event:'click',stop:true,target:window,reset:true};g.hash=function(a){if(location.hash){a=$.extend({},g.defaults,a);a.hash=false;if(a.reset){var e=a.duration;delete a.duration;$(a.target).scrollTo(0,a);a.duration=e}i(0,location,a)}};$.fn.localScroll=function(b){b=$.extend({},g.defaults,b);return b.lazy?this.bind(b.event,function(a){var e=$([a.target,a.target.parentNode]).filter(d)[0];if(e)i(a,e,b)}):this.find('a,area').filter(d).bind(b.event,function(a){i(a,this,b)}).end().end();function d(){return!!this.href&&!!this.hash&&this.href.replace(this.hash,'')==l&&(!b.filter||$(this).is(b.filter))}};function i(a,e,b){var d=e.hash.slice(1),f=document.getElementById(d)||document.getElementsByName(d)[0];if(!f)return;if(a)a.preventDefault();var h=$(b.target);if(b.lock&&h.is(':animated')||b.onBefore&&b.onBefore.call(b,a,f,h)===false)return;if(b.stop)h.stop(true);if(b.hash){var j=f.id==d?'id':'name',k=$(' ').attr(j,d).css({position:'absolute',top:$(window).scrollTop(),left:$(window).scrollLeft()});f[j]='';$('body').prepend(k);location=e.hash;k.remove();f[j]=d}h.scrollTo(f,b).trigger('notify.serialScroll',[f])}})(jQuery); /** * Copyright (c) 2007-2012 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com * Dual licensed under MIT and GPL. * @author Ariel Flesler * @version 1.4.5 BETA */ ;(function($){var h=$.scrollTo=function(a,b,c){$(window).scrollTo(a,b,c)};h.defaults={axis:'xy',duration:parseFloat($.fn.jquery)>=1.3?0:1,limit:true};h.window=function(a){return $(window)._scrollable()};$.fn._scrollable=function(){return this.map(function(){var a=this,isWin=!a.nodeName||$.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!isWin)return a;var b=(a.contentWindow||a).document||a.ownerDocument||a;return/webkit/i.test(navigator.userAgent)||b.compatMode=='BackCompat'?b.body:b.documentElement})};$.fn.scrollTo=function(e,f,g){if(typeof f=='object'){g=f;f=0}if(typeof g=='function')g={onAfter:g};if(e=='max')e=9e9;g=$.extend({},h.defaults,g);f=f||g.duration;g.queue=g.queue&&g.axis.length>1;if(g.queue)f/=2;g.offset=both(g.offset);g.over=both(g.over);return this._scrollable().each(function(){if(e==null)return;var d=this,$elem=$(d),targ=e,toff,attr={},win=$elem.is('html,body');switch(typeof targ){case'number':case'string':if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(targ)){targ=both(targ);break}targ=$(targ,this);if(!targ.length)return;case'object':if(targ.is||targ.style)toff=(targ=$(targ)).offset()}$.each(g.axis.split(''),function(i,a){var b=a=='x'?'Left':'Top',pos=b.toLowerCase(),key='scroll'+b,old=d[key],max=h.max(d,a);if(toff){attr[key]=toff[pos]+(win?0:old-$elem.offset()[pos]);if(g.margin){attr[key]-=parseInt(targ.css('margin'+b))||0;attr[key]-=parseInt(targ.css('border'+b+'Width'))||0}attr[key]+=g.offset[pos]||0;if(g.over[pos])attr[key]+=targ[a=='x'?'width':'height']()*g.over[pos]}else{var c=targ[pos];attr[key]=c.slice&&c.slice(-1)=='%'?parseFloat(c)/100*max:c}if(g.limit&&/^\d+$/.test(attr[key]))attr[key]=attr[key]<=0?0:Math.min(attr[key],max);if(!i&&g.queue){if(old!=attr[key])animate(g.onAfterFirst);delete attr[key]}});animate(g.onAfter);function animate(a){$elem.animate(attr,f,g.easing,a&&function(){a.call(this,e,g)})}}).end()};h.max=function(a,b){var c=b=='x'?'Width':'Height',scroll='scroll'+c;if(!$(a).is('html,body'))return a[scroll]-$(a)[c.toLowerCase()]();var d='client'+c,html=a.ownerDocument.documentElement,body=a.ownerDocument.body;return Math.max(html[scroll],body[scroll])-Math.min(html[d],body[d])};function both(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery); $(document).ready(function(){ $('.onepage .scroll,.onepage .navbar .nav').localScroll({ offset: {top:-58, left:0} }); $('.onepage .nav li a').on('click',function(){ $('.onepage .navbar-collapse.in').collapse('hide'); }) });