jQuery(document).ready(function($) { "use strict"; $(".clients-slide").owlCarousel({ margin: 0, loop:true, nav: $('.clients-slide').data('nav'), dots: $('.clients-slide').data('dots'), autoplay: true, autoplayTimeout: 2000, smartSpeed: 800, responsive:{ 0:{ items:1 }, 576:{ items:3 }, 768:{ items:4 }, 992:{ items:4 } } }); $(window).scroll(function () { //console.log($(this).scrollTop()); if ($(this).scrollTop() > 600) { $('#to-the-top').fadeIn(); } else { $('#to-the-top').fadeOut(); } }); $('#to-the-top').click(function() { $('body,html').animate({scrollTop: 0}, 1000); }); var $sticky_header = $('#ABdev_sticky_header'); var $header = $('body > header'); $header.css('marginTop', $('html').css('marginTop')); $sticky_header.css('marginTop', $('html').css('marginTop')); if($sticky_header.length > 0){ $(document).scroll(function(){ var header_height = $header.height() + parseInt($('html').css('marginTop'),10) + 3; var top = $('#ABdev_sticky_header_content').offset().top - $(document).scrollTop(); if(top 0){ $knob_countdown.show(); $(".knob").knob(); countdown_knob(); } function header_menu_line() { $("#magic-line").remove(); $("#main_menu").append("
  • "); var $magicLine = $("#magic-line"); if($magicLine.length > 0){ var position; if(jQuery(".current-menu-ancestor").length > 0){ position = $(".current-menu-ancestor").position().left + ($(".current-menu-ancestor").width()-70)/2; } else if(jQuery("#main_menu .current-menu-item").length > 0){ position = $("#main_menu .current-menu-item").position().left + ($("#main_menu .current-menu-item").width()-70)/2; } else{ position=0; } $magicLine .css("left", position) .data("origLeft", $magicLine.position().left); $("#main_menu > li").hover(function() { var position = $(this).position().left + ($(this).width()-70)/2; $magicLine.stop().animate({ left: position }, 300); }, function() { $magicLine.stop().animate({ left: $magicLine.data("origLeft") }, 300); }); } } $(window).load(function() { header_menu_line();} ); $('.accordion-group').on('show', function() { $(this).find('i').removeClass('icon-plus').addClass('icon-minus'); }); $('.accordion-group').on('hide', function() { $(this).find('i').removeClass('icon-minus').addClass('icon-plus'); }); var sf, body; body = $('body'); sf = $('#main_menu'); if($('#ABdev_menu_toggle').css('display') === 'none') { // enable superfish when the page first loads if we're on desktop sf.superfish({ delay: 300, animation: {opacity:'show',height:'show'}, animationOut: {height:'hide'}, speed: 'fast', speedOut: 'fast', cssArrows: false, disableHI: true /* load hoverIntent.js in header to use this option */, onBeforeShow: function(){ var ww = $(window).width(); var locUL = this.parent().offset().left + this.width(); var locsubUL = this.parent().offset().left + this.parent().width() + this.width(); var parpar = this.parent().parent(); if(parpar.is("#main_menu") && (locUL > ww)){ this.css('marginLeft', "-"+(locUL-ww+20)+"px"); } else if (!parpar.is("#main_menu") && (locsubUL > ww)){ this.css('left', "-"+(this.width())+"px"); } } }); } $('#ABdev_menu_toggle').click(function(){ if(sf.css('display') === 'none'){ sf.show(); } else{ sf.hide(); } }); //contact page google maps /* function initialize_gmap() { var $map_element = $('#contact_map'); var myLatlng = new google.maps.LatLng($map_element.data('lat'),$map_element.data('lng')); var markerLatlng = new google.maps.LatLng($map_element.data('markerlat'),$map_element.data('markerlng')); var map_type = google.maps.MapTypeId.ROADMAP; if ($map_element.data('maptype') == 'SATELLITE') map_type = google.maps.MapTypeId.SATELLITE; if ($map_element.data('maptype') == 'HYBRID') map_type = google.maps.MapTypeId.HYBRID; if ($map_element.data('maptype') == 'TERRAIN') map_type = google.maps.MapTypeId.TERRAIN; var mapOptions = { zoom: parseInt($map_element.data('zoom'),10), center: myLatlng, mapTypeId: map_type, scrollwheel: $map_element.data('scrollwheel'), mapTypeControl: $map_element.data('maptypecontrol'), mapTypeControlOptions: { style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR, position: google.maps.ControlPosition.BOTTOM_CENTER }, panControl: $map_element.data('pancontrol'), panControlOptions: { position: google.maps.ControlPosition.RIGHT_CENTER }, zoomControl: $map_element.data('zoomcontrol'), zoomControlOptions: { style: google.maps.ZoomControlStyle.LARGE, position: google.maps.ControlPosition.RIGHT_CENTER }, scaleControl: $map_element.data('scalecontrol'), scaleControlOptions: { position: google.maps.ControlPosition.BOTTOM_LEFT }, streetViewControl: false, streetViewControlOptions: { position: google.maps.ControlPosition.RIGHT_CENTER } }; var map = new google.maps.Map(document.getElementById('contact_map'), mapOptions); var infowindow = new google.maps.InfoWindow({ content: $map_element.data('markercontent') }); var marker = new google.maps.Marker({ position: markerLatlng, map: map, title: $map_element.data('markertitle') }); google.maps.event.addListener(marker, 'click', function() { infowindow.open(map,marker); }); } if($('#contact_map').length > 0){ google.maps.event.addDomListener(window, 'load', initialize_gmap); } */ //contact page google street view function initialize_streetview() { var $street_view_element = $('#contact_streetview'); var fenway = new google.maps.LatLng($street_view_element.data('lat'),$street_view_element.data('lng')); var panoOptions = { position: fenway, pov: { heading: parseInt($street_view_element.data('heading'), 10), //True north is 0, east is 90, south is 180, west is 270 pitch: parseInt($street_view_element.data('pitch'), 10) //The camera pitch in degrees, relative to the street view vehicle. Ranges from 90 (directly upwards) to -90 (directly downwards). }, zoom: parseInt($street_view_element.data('zoom'), 10), clickToGo: $street_view_element.data('clicktogo'), addressControl: false, disableDoubleClickZoom: $street_view_element.data('disabledoubleclickzoom'), linksControl: $street_view_element.data('linkscontrol'), scrollwheel: $street_view_element.data('scrollwheel'), panControl: $street_view_element.data('pancontrol'), panControlOptions: { position: google.maps.ControlPosition.RIGHT_CENTER }, zoomControl: $street_view_element.data('zoomcontrol'), zoomControlOptions: { position: google.maps.ControlPosition.RIGHT_CENTER }, }; var panorama = new google.maps.StreetViewPanorama( document.getElementById('contact_streetview'), panoOptions); if($street_view_element.data('rotation')==true){ window.setInterval(function() { var pov = panorama.getPov(); pov.heading += parseFloat($street_view_element.data('rotationstep')); panorama.setPov(pov); }, 50); } } if($('#contact_streetview').length > 0){ google.maps.event.addDomListener(window, 'load', initialize_streetview); } $(".fancybox").fancybox({ 'transitionIn' : 'elastic', 'transitionOut' : 'elastic', 'titlePosition' : 'over', 'cyclic' : true, 'overlayShow' : true, 'titleFormat' : function(title, currentArray, currentIndex) { return 'Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? '   ' + title : '') + ''; } }); /* $(".submit").click(function () { $(this).closest("form").submit(); }); */ $('input, textarea').placeholder(); $('.overlayed_animated_highlight').find('.overlayed').append("
    "); var $highlight; $('.overlayed_animated_highlight').mouseenter(function(){ var height; height = parseInt($(this).find('h4').css('height'), 10) + parseInt($(this).find('span').css('height'), 10) + 35; $highlight = $(this).find('.overlayed_after'); $highlight.animate({ height: height+'px' },180); }).mouseleave(function(){ $highlight.animate({ height: '5px' },180); }); var $content = $("#timeline_posts"); var itemSelector = ('.timeline_post'); function Timeline_Classes(){ $content.find(itemSelector).each(function(){ var posLeft = $(this).css("left"); if(posLeft == "0px"){ $(this).removeClass('timeline_post_right').addClass('timeline_post_left'); } else{ $(this).removeClass('timeline_post_left').addClass('timeline_post_right'); } }); } $content.imagesLoaded( function() { $content.masonry({ columnWidth: ".timeline_post_first", gutter: 100, itemSelector: itemSelector, }); Timeline_Classes(); }); var $isotope_container = $('#portfolio_items'); $isotope_container.imagesLoaded( function() { $isotope_container.isotope({ itemSelector : '.portfolio_item', animationEngine: 'best-available', }); var $optionSets = $('.option-set'), $optionLinks = $optionSets.find('a'); $optionLinks.click(function(){ var $this = $(this); if ( $this.hasClass('selected') ) { return false; } var $optionSet = $this.parents('.option-set'); $optionSet.find('.selected').removeClass('selected'); $this.addClass('selected'); var options = {}, key = $optionSet.attr('data-option-key'), value = $this.attr('data-option-value'); value = value === 'false' ? false : value; options[ key ] = value; if ( key === 'layoutMode' && typeof changeLayoutMode === 'function' ) { changeLayoutMode( $this, options ); } else { $isotope_container.isotope( options ); } return false; }); }); $(window).resize(function() { header_menu_line(); Timeline_Classes(); $('#portfolio_items').isotope('reLayout'); if($('#ABdev_menu_toggle').css('display') === 'none' && !sf.hasClass('sf-js-enabled')) { // you only want SuperFish to be re-enabled once (sf.hasClass) sf.show(); sf.superfish({ delay: 300, animation: {opacity:'show',height:'show'}, animationOut: {height:'hide'}, speed: 'fast', speedOut: 'fast', cssArrows: false, disableHI: true /* load hoverIntent.js in header to use this option */, onBeforeShow: function(){ var ww = $(window).width(); var locUL = this.parent().offset().left + this.width(); var locsubUL = this.parent().offset().left + this.parent().width() + this.width(); var par = this.parent(); if(par.hasClass("menu-item-depth-0") && (locUL > ww)){ this.css('marginLeft', "-"+(locUL-ww+20)+"px"); } else if (!par.hasClass("menu-item-depth-0") && (locsubUL > ww)){ this.css('left', "-"+(this.width())+"px"); } } }); } else if($('#ABdev_menu_toggle').css('display') != 'none' && sf.hasClass('sf-js-enabled')) { // smaller screen, disable SuperFish sf.superfish('destroy'); sf.hide(); } }); /*********** Animations ************************************************************/ $(".ABs-animo").one('inview', function(event, isInView) { if (isInView) { var animation = $(this).data('animation'); var duration = $(this).data('duration')/1000; var delay = parseInt($(this).data('delay'),10); var $element = $(this); setTimeout(function() { $element.css({visibility: "visible"}).animo( { animation: animation, duration: duration} ); }, delay); } }); $(".ABs-animo-children").one('inview', function(event, isInView) { var animation = $(this).data('animation'); var duration = $(this).data('duration')/1000; var delay = parseInt($(this).data('delay'),10); var difference = 0; if (isInView) { $(this).children().each(function(){ var $element = $(this); setTimeout(function() { $element.css({visibility: "visible"}).animo( { animation: animation, duration: duration} ); }, difference); difference = difference + delay; }); } }); /*********** Accordions ************************************************************/ $( ".ABs-accordion" ).accordion({ collapsible: true, active: false, heightStyle: "content", create: function( event, ui ) { var expanded = $(this).data("expanded"); if(expanded===0){ expanded = false; } else{ expanded = expanded-1; } $(this).accordion( "option", "active", expanded); }, }); /*********** Tabs ************************************************************/ $('.ABs-tabs-horizontal').each(function() { var optionSelected = $(this).data("selected")-1; $(this).tabs({ active:optionSelected, beforeActivate: function( event, ui ) { var parent = ui.oldPanel.parent(); var diffHeight = parent.height() - (ui.oldPanel.height() - ui.newPanel.height()); parent.animate({height: diffHeight}, 300, function() { parent.height('auto'); }); if (ui.newTab.index() > ui.oldTab.index()) $( ".ABs-tabs-horizontal" ).tabs( "option", "show", { effect: "slide", direction: "right", duration: 400 } ); else $( ".ABs-tabs-horizontal" ).tabs( "option", "show", { effect: "slide", direction: "left", duration: 400 } ); }, }); }); $('.ABs-tabs-vertical').each(function() { var optionSelected = $(this).data("selected")-1; $(this).tabs({ active:optionSelected, beforeActivate: function( event, ui ) { var parent = ui.oldPanel.parent(); var diffHeight = parent.height() - (ui.oldPanel.height() - ui.newPanel.height()); parent.animate({height: diffHeight}, 300, function() { parent.height('auto'); }); if (ui.newTab.index() > ui.oldTab.index()) $( ".ABs-tabs-vertical" ).tabs( "option", "show", { effect: "slide", direction: "down", duration: 400 } ); else $( ".ABs-tabs-vertical" ).tabs( "option", "show", { effect: "slide", direction: "up", duration: 400 } ); }, }); }); $('#ABp_latest_portfolio').carouFredSel({ prev: '#portfolio_prev', next: '#portfolio_next', auto: false, width: '100%', scroll: 1, }); /*********** Alert Box ************************************************************/ $( ".ABs_alert_box_close" ).click(function(){ var $parent = $(this).parent(); $parent.animate({height:"0px", paddingTop:"0px", paddingBottom:"0px", margin:"0px", opacity:"0"},400); }); /*********** Stats excerpt counter ************************************************************/ function ABs_counter($object,interval,max,increment) { var number = parseInt($object.text(),10) + increment; $object.text(number); if (number < max) setTimeout(function() {ABs_counter($object,interval,max,increment);} ,interval); } $(".ABs_stats_number").one('inview', function(event, isInView) { if (isInView) { $(this).each(function(){ var max = $(this).data("number"); var increment = 1; if (max > 50) increment = 10; if (max > 500) increment = 100; if (max > 5000) increment = 200; if (max > 10000) increment = 1000; var interval = $(this).data("duration")/(max/increment); $(this).text('0'); ABs_counter($(this),interval,max,increment); }); } }); /*********** PrettyPrint ************************************************************/ $(function(){ window.prettyPrint && prettyPrint(); }); /*********** Tooltip ************************************************************/ $('.ABs_tooltip').tipsy({ fade: true, gravity: function(){ return $(this).data("gravity"); } }); /*********** Back to Top ************************************************************/ $('.ABs_divider a').click(function(){ event.preventDefault ? event.preventDefault() : event.returnValue = false; $('html, body').animate({scrollTop:0}, 'slow'); }); /*********** Progress Bar ************************************************************/ $(".ABs_meter > span").width(0); $(".ABs_meter > span").one('inview', function(event, isInView) { if (isInView) { var newwidth = $(this).data("percentage") + '%'; $(this).animate({width: newwidth}, { duration:1500, step: function(now) { $(this).html(Math.round(now) + '%'); } }); } }); $('.ABt_testimonials_wrapper').each(function() { var $slider = $(this).find('.ABt_testimonials_slide'); var fx = $slider.data("fx"); var play = $slider.data("play"); var easing = $slider.data("easing"); var direction = $slider.data("direction"); var duration = parseInt($slider.data("duration"), 10); var pauseonhover = $slider.data("pauseonhover"); var timeoutduration = parseInt($slider.data("timeoutduration"), 10); var $prev = $(this).find('.ABt_prev'); var $next = $(this).find('.ABt_next'); $slider.carouFredSel({ prev : $prev, next : $next, direction : direction, responsive : true, auto : { play : play, fx : fx, easing : easing, duration : duration, pauseOnHover : pauseonhover, timeoutDuration : timeoutduration, }, scroll : { fx : fx, easing : easing, duration : duration, }, width : 'auto', items : { visible:1, }, }); }); });