1jQuery(function($) {'use strict'; 2 3 // Navigation Scroll 4 $(window).scroll(function(event) { 5 Scroll(); 6 }); 7 8 $('.navbar-collapse ul li a').on('click', function() { 9 $('html, body').animate({scrollTop: $(this.hash).offset().top - 5}, 1000); 10 return false; 11 }); 12 13 // User define function 14 function Scroll() { 15 var contentTop = []; 16 var contentBottom = []; 17 var winTop = $(window).scrollTop(); 18 var rangeTop = 200; 19 var rangeBottom = 500; 20 $('.navbar-collapse').find('.scroll a').each(function(){ 21 contentTop.push( $( $(this).attr('href') ).offset().top); 22 contentBottom.push( $( $(this).attr('href') ).offset().top + $( $(this).attr('href') ).height() ); 23 }) 24 $.each( contentTop, function(i){ 25 if ( winTop > contentTop[i] - rangeTop ){ 26 $('.navbar-collapse li.scroll') 27 .removeClass('active') 28 .eq(i).addClass('active'); 29 } 30 }) 31 }; 32 33 $('#tohash').on('click', function(){ 34 $('html, body').animate({scrollTop: $(this.hash).offset().top - 5}, 1000); 35 return false; 36 }); 37 38 // accordian 39 $('.accordion-toggle').on('click', function(){ 40 $(this).closest('.panel-group').children().each(function(){ 41 $(this).find('>.panel-heading').removeClass('active'); 42 }); 43 44 $(this).closest('.panel-heading').toggleClass('active'); 45 }); 46 47 //Slider 48 $(document).ready(function() { 49 var time = 7; // time in seconds 50 51 var $progressBar, 52 $bar, 53 $elem, 54 isPause, 55 tick, 56 percentTime; 57 58 //Init the carousel 59 $("#main-slider").find('.owl-carousel').owlCarousel({ 60 slideSpeed : 100, 61 paginationSpeed : 100, 62 singleItem : true, 63 navigation : true, 64 navigationText: [ 65 "<i class='fa fa-angle-left'></i>", 66 "<i class='fa fa-angle-right'></i>" 67 ], 68 afterInit : progressBar, 69 afterMove : moved, 70 startDragging : pauseOnDragging, 71 //autoHeight : true, 72 transitionStyle : "fadeUp" 73 }); 74 75 //Init progressBar where elem is $("#owl-demo") 76 function progressBar(elem){ 77 $elem = elem; 78 //build progress bar elements 79 buildProgressBar(); 80 //start counting 81 start(); 82 } 83 84 //create div#progressBar and div#bar then append to $(".owl-carousel") 85 function buildProgressBar(){ 86 $progressBar = $("<div>",{ 87 id:"progressBar" 88 }); 89 $bar = $("<div>",{ 90 id:"bar" 91 }); 92 $progressBar.append($bar).appendTo($elem); 93 } 94 95 function start() { 96 //reset timer 97 percentTime = 0; 98 isPause = false; 99 //run interval every 0.01 second 100 tick = setInterval(interval, 10); 101 }; 102 103 function interval() { 104 if(isPause === false){ 105 percentTime += 1 / time; 106 $bar.css({ 107 width: percentTime+"%" 108 }); 109 //if percentTime is equal or greater than 100 110 if(percentTime >= 100){ 111 //slide to next item 112 $elem.trigger('owl.next') 113 } 114 } 115 } 116 117 //pause while dragging 118 function pauseOnDragging(){ 119 isPause = true; 120 } 121 122 //moved callback 123 function moved(){ 124 //clear interval 125 clearTimeout(tick); 126 //start again 127 start(); 128 } 129 }); 130 131 //Initiat WOW JS 132 new WOW().init(); 133 //smoothScroll 134 smoothScroll.init(); 135 136 // portfolio filter 137 $(window).load(function(){'use strict'; 138 var $portfolio_selectors = $('.portfolio-filter >li>a'); 139 var $portfolio = $('.portfolio-items'); 140 $portfolio.isotope({ 141 itemSelector : '.portfolio-item', 142 layoutMode : 'fitRows' 143 }); 144 145 $portfolio_selectors.on('click', function(){ 146 $portfolio_selectors.removeClass('active'); 147 $(this).addClass('active'); 148 var selector = $(this).attr('data-filter'); 149 $portfolio.isotope({ filter: selector }); 150 return false; 151 }); 152 }); 153 154 $(document).ready(function() { 155 //Animated Progress 156 $('.progress-bar').bind('inview', function(event, visible, visiblePartX, visiblePartY) { 157 if (visible) { 158 $(this).css('width', $(this).data('width') + '%'); 159 $(this).unbind('inview'); 160 } 161 }); 162 163 //Animated Number 164 $.fn.animateNumbers = function(stop, commas, duration, ease) { 165 return this.each(function() { 166 var $this = $(this); 167 var start = parseInt($this.text().replace(/,/g, "")); 168 commas = (commas === undefined) ? true : commas; 169 $({value: start}).animate({value: stop}, { 170 duration: duration == undefined ? 1000 : duration, 171 easing: ease == undefined ? "swing" : ease, 172 step: function() { 173 $this.text(Math.floor(this.value)); 174 if (commas) { $this.text($this.text().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")); } 175 }, 176 complete: function() { 177 if (parseInt($this.text()) !== stop) { 178 $this.text(stop); 179 if (commas) { $this.text($this.text().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")); } 180 } 181 } 182 }); 183 }); 184 }; 185 186 $('.animated-number').bind('inview', function(event, visible, visiblePartX, visiblePartY) { 187 var $this = $(this); 188 if (visible) { 189 $this.animateNumbers($this.data('digit'), false, $this.data('duration')); 190 $this.unbind('inview'); 191 } 192 }); 193 }); 194 195 // Contact form 196/* var form = $('#main-contact-form'); 197 form.submit(function(event){ 198 event.preventDefault(); 199 var form_status = $('<div class="form_status"></div>'); 200 $.ajax({
201 url: $(this).attr('action'), 202 beforeSend: function(){ 203 form.prepend( form_status.html('<p><i class="fa fa-spinner fa-spin"></i> Email is sending...</p>').fadeIn() ); 204 } 205 }).done(function(data){ 206 form_status.html('<p class="text-success">Thank you for contact us. As early as possible we will contact you</p>').delay(3000).fadeOut(); 207 }); 208 });*/ 209 210 //Pretty Photo 211 $("a[rel^='prettyPhoto']").prettyPhoto({ 212 social_tools: false 213 }); 214 215 //Google Map 216 var latitude = $('#google-map').data('latitude'); 217 var longitude = $('#google-map').data('longitude'); 218 function initialize_map() { 219 var myLatlng = new google.maps.LatLng(latitude,longitude); 220 var mapOptions = { 221 scrollwheel:true, 222 center: myLatlng 223 }; 224 var map = new google.maps.Map(document.getElementById('google-map'), mapOptions); 225 var marker = new google.maps.Marker({ 226 position: myLatlng, 227 map: map 228 }); 229 } 230 google.maps.event.addDomListener(window, 'load', initialize_map); 231 232});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.