/* SHARED VARS */ /*global jQuery:false */ var j = jQuery.noConflict(); var x = jQuery.noConflict(); // handles Animate var x= jQuery.noConflict(); //Initialize flex slider x(window).load(function (){ "use strict"; x('.flexslider').flexslider({ animation:"slide", start:function() { x('body').removeClass('loading'); } }); if (x('#projects').length > 0) { //Projects filter var xcontainer = x('#projects'); // items filter x('.project-filter li a').click(function () { var selector = x(this).attr('data-filter'); xcontainer.isotope({ filter: selector, itemSelector: '.project-item', layoutMode: 'fitRows', animationEngine: 'jQuery' }); x('.project-filter').find('a.active').removeClass('active'); x(this).addClass('active'); return false; }); //causes initial setup setTimeout(function(){ x('.project-filter li a:eq(0)').click(); },1000); } }); //back to top (function ($) { jQuery('.back_to_top').click(function(){ jQuery('html, body').animate({scrollTop:0}, 'fast'); return false; }); })(jQuery); /*global $:false */ jQuery.noConflict(); /*RESPONSIVE MAIN NAVIGATION STARTS*/ mainNavChildren(jQuery(".menu-header_menu-container > ul") , 0); function mainNavChildren(parent , level){ jQuery(parent).children("li").each(function(i , obj){ var label = ""; for(var k = 0 ; k < level ; k++){ label += "    "; } var text = ''; jQuery(obj).children("a").contents().each(function(){ if(this.nodeType === 3){ text += this.wholeText; } }); label += text; //label += jQuery(obj).not('li a span').children("a").text(); jQuery("#responsive-main-nav-menu").append(""); if(jQuery(obj).children("ul").size() == 1){ mainNavChildren(jQuery(obj).children("ul") , level + 1); } }); } /*RESPONSIVE MAIN NAVIGATION STARTS*/ jQuery(document).ready(function() { "use strict"; jQuery('.accordion-body.in').parent().addClass('active'); jQuery('.accordion-toggle').click(function() { jQuery('.accordion-group').removeClass('active'); jQuery(this).parent().parent().addClass('active'); }); jQuery('.sub-menu').each(function () { jQuery(this).parent().eq(0).hoverIntent({ timeout: 100, over: function () { var current = jQuery('.sub-menu:eq(0)', this); current.slideDown(300); }, out: function () { var current = jQuery('.sub-menu:eq(0)', this); current.fadeOut(100); } }); }); jQuery('.post-thumb .overlay .more').each(function() { var imghh=jQuery(this).parents('.post-thumb').children('img').height(); jQuery(this).css('margin-top',((imghh/2)-22)+'px'); }); jQuery('.portfolio article .post-thumb .icons').each(function() { var imghh=jQuery(this).parents('.post-thumb').children('img').height(); jQuery(this).css('margin-top',((imghh/2)-22)+'px'); }); jQuery('.portfolio article .post-content .icon').each(function() { var hh=jQuery(this).parents('.post-content').children('.text').height(); jQuery(this).css('height',hh+'px'); }); jQuery('article .post-thumb').each(function() { var ieh=jQuery(this).children('img').height(); jQuery(this).css('height',ieh+'px'); }); jQuery(".services .item").hover( function() { "use strict"; jQuery(this).children(".rotate-img").rotate({animateTo:180}); }, function() { "use strict"; jQuery(this).children(".rotate-img").rotate({animateTo:0}); } ); }); //Initialize video background jQuery(function(){ 'use strict'; jQuery(".player").mb_YTPlayer(); }); //Initialize counter for numbers jQuery(document).ready(function ($) { $('.counter').counterUp({ delay: 10, time: 300 }); }); (function() { "use strict"; j('body').addClass('notouch'); })(jQuery); (function ($) { "use strict"; //Stellar init $.stellar({ horizontalScrolling: false, verticalScrolling: true, verticalOffset: 0, horizontalOffset: 0, // Refreshes parallax content on window load and resize responsive: false, // Select which property is used to calculate scroll. // Choose 'scroll', 'position', 'margin' or 'transform', // or write your own 'scrollProperty' plugin. scrollProperty: 'transform', // Select which property is used to position elements. // Choose between 'position' or 'transform', // or write your own 'positionProperty' plugin. positionProperty: 'transform', // Enable or disable the two types of parallax parallaxBackgrounds: true, parallaxElements: false, // Hide parallax elements that move outside the viewport hideDistantElements: true, // Customise how elements are shown and hidden hideElement: function($elem) { $elem.hide(); }, showElement: function($elem) { $elem.show(); } }); })(jQuery);