jQuery(function($) {'use strict'; // Navigation Scroll $(window).scroll(function(event) { Scroll(); }); $('.navbar-collapse ul li a').on('click', function() { $('html, body').animate({scrollTop: $(this.hash).offset().top - 5}, 1000); return false; }); // User define function function Scroll() { var contentTop = []; var contentBottom = []; var winTop = $(window).scrollTop(); var rangeTop = 200; var rangeBottom = 500; $('.navbar-collapse').find('.scroll a').each(function(){ contentTop.push( $( $(this).attr('href') ).offset().top); contentBottom.push( $( $(this).attr('href') ).offset().top + $( $(this).attr('href') ).height() ); }) $.each( contentTop, function(i){ if ( winTop > contentTop[i] - rangeTop ){ $('.navbar-collapse li.scroll') .removeClass('active') .eq(i).addClass('active'); } }) }; $('#tohash').on('click', function(){ $('html, body').animate({scrollTop: $(this.hash).offset().top - 5}, 1000); return false; }); // accordian $('.accordion-toggle').on('click', function(){ $(this).closest('.panel-group').children().each(function(){ $(this).find('>.panel-heading').removeClass('active'); }); $(this).closest('.panel-heading').toggleClass('active'); }); //Slider $(document).ready(function() { var time = 7; // time in seconds var $progressBar, $bar, $elem, isPause, tick, percentTime; //Init the carousel $("#main-slider").find('.owl-carousel').owlCarousel({ slideSpeed : 500, paginationSpeed : 500, singleItem : true, navigation : true, navigationText: [ "", "" ], afterMove : moved, startDragging : pauseOnDragging, //autoHeight : true, transitionStyle : "fade" }); //Init progressBar where elem is $("#owl-demo") function progressBar(elem){ $elem = elem; //build progress bar elements buildProgressBar(); //start counting start(); } //create div#progressBar and div#bar then append to $(".owl-carousel") function buildProgressBar(){ $progressBar = $("
Email is sending...
').fadeIn() ); } }).done(function(data){ form_status.html('Thank you for contact us. As early as possible we will contact you
').delay(3000).fadeOut(); }); }); //Pretty Photo $("a[rel^='prettyPhoto']").prettyPhoto({ social_tools: false }); //Google Map var latitude = $('#google-map').data('latitude'); var longitude = $('#google-map').data('longitude'); function initialize_map() { var myLatlng = new google.maps.LatLng(latitude,longitude); var mapOptions = { zoom: 14, scrollwheel: false, center: myLatlng }; var map = new google.maps.Map(document.getElementById('google-map'), mapOptions); var marker = new google.maps.Marker({ position: myLatlng, map: map }); } google.maps.event.addDomListener(window, 'load', initialize_map); });