1/** ========================================================================================== 2 3 Project : Altech - Responsive Multi-purpose HTML5 Template 4 Version : Bootstrap 4.1.1 5 Author : Themetechmount 6 7========================================================================================== */ 8 9/** =============== 10 111. Preloader 122. TopSearch 133. Fixed-header 144. Menu 155. Number rotator 166. Enables menu toggle 177. Skillbar 188. Tab 199. Accordion 2010. Isotope 2111. Prettyphoto 2212. owlCarousel 23 24 .. Services slide 25 .. Team slide 26 .. Testimonial slide2 27 .. Blog slide 28 .. Clients-slide 29 .. Portfolio-slide 30 .. Testimonial slide 31 .. Portfolio-img-slide 32 .. Clients-slide2 33 3413. Back to top 35 36 =============== */ 37 38 39 40(function($) { 41 42 'use strict' 43 44 45/*------------------------------------------------------------------------------*/ 46/* Preloader 47/*------------------------------------------------------------------------------*/ 48// makes sure the whole site is loaded 49 $(window).on("load",function() { 50 // will first fade out the loading animation 51 $("#preloader").fadeOut(); 52 // will fade out the whole DIV that covers the website. 53 $("#status").fadeOut(9000); 54}) 55 56 57/*------------------------------------------------------------------------------*/ 58/* TopSearch 59/*------------------------------------------------------------------------------*/ 60 61 62 jQuery( ".ttm-header-search-link a" ).addClass('sclose'); 63 64 jQuery( ".ttm-header-search-link a" ).on('click', function(event ) { 65 66 jQuery(".field.searchform-s").focus(); 67 68 if (jQuery('.ttm-header-search-link a').hasClass('sclose')) { 69 jQuery( ".ttm-header-search-link a i" ).removeClass('ti-search').addClass('ti-close'); 70 jQuery(this).removeClass('sclose').addClass('open'); 71 jQuery(".ttm-search-overlay").addClass('st-show'); 72 } else { 73 jQuery(this).removeClass('open').addClass('sclose'); 74 jQuery( ".ttm-header-search-link a i" ).removeClass('ti-close').addClass('ti-search'); 75 jQuery(".ttm-search-overlay").removeClass('st-show'); 76 } 77 event.preventDefault(); 78 }); 79 80 81/*------------------------------------------------------------------------------*/ 82/* Fixed-header 83/*------------------------------------------------------------------------------*/ 84 85 86$(window).scroll(function(){ 87 if ( matchMedia( 'only screen and (min-width: 1200px)' ).matches ) 88 { 89 if ($(window).scrollTop() >= 50 ) { 90 $('.ttm-stickable-header').addClass('fixed-header'); 91 $('.ttm-stickable-header').addClass('visible-title'); 92 } 93 else { 94 95 $('.ttm-stickable-header').removeClass('fixed-header'); 96 $('ttm-stickable-header').removeClass('visible-title'); 97 } 98 } 99}); 100 101 102/*------------------------------------------------------------------------------*/ 103/* Menu 104/*------------------------------------------------------------------------------*/ 105 106 $('ul li:has(ul)').addClass('has-submenu'); 107 $('ul li ul').addClass('sub-menu'); 108 109 110 $("ul.dropdown li").on({ 111 112 mouseover: function(){ 113 $(this).addClass("hover"); 114 }, 115 mouseout: function(){ 116 $(this).removeClass("hover"); 117 }, 118 119 }); 120 121 var $menu = $('#menu'), $menulink = $('#menu-toggle-form'), $menuTrigger = $('.has-submenu > a'); 122 $menulink.on('click',function (e) { 123 124 $menulink.toggleClass('active'); 125 $menu.toggleClass('active'); 126 }); 127 128 $menuTrigger.on('click',function (e) { 129 e.preventDefault(); 130 var t = $(this); 131 t.toggleClass('active').next('ul').toggleClass('active'); 132 }); 133 134 $('ul li:has(ul)'); 135 136 137/*------------------------------------------------------------------------------*/ 138/* Animation on scroll: Number rotator 139/*------------------------------------------------------------------------------*/ 140 141 $("[data-appear-animation]").each(function() { 142 var self = $(this); 143 var animation = self.data("appear-animation"); 144 var delay = (self.data("appear-animation-delay") ? self.data("appear-animation-delay") : 0); 145 146 if( $(window).width() > 959 ) { 147 self.html('0'); 148 self.waypoint(function(direction) { 149 if( !self.hasClass('completed') ){ 150 var from = self.data('from'); 151 var to = self.data('to'); 152 var interval = self.data('interval'); 153 self.numinate({ 154 format: '%counter%', 155 from: from, 156 to: to, 157 runningInterval: 2000, 158 stepUnit: interval, 159 onComplete: function(elem) { 160 self.addClass('completed'); 161 } 162 }); 163 } 164 }, { offset:'85%' }); 165 } else { 166 if( animation == 'animateWidth' ) { 167 self.css('width', self.data("width")); 168 } 169 } 170 }); 171 172 173/*------------------------------------------------------------------------------*/ 174/* Skillbar 175/*------------------------------------------------------------------------------*/ 176 177 $('.ttm-progress-bar').each(function() { 178 $(this).find('.progress-bar').width(0); 179 }); 180 181 $('.ttm-progress-bar').each(function() { 182 183 $(this).find('.progress-bar').animate({ 184 width: $(this).attr('data-percent') 185 }, 2000); 186 }); 187 188 // Part of the code responsible for loading percentages: 189 190 $('.progress-bar-percent[data-percentage]').each(function () { 191 192 var progress = $(this);
193 var percentage = Math.ceil($(this).attr('data-percentage')); 194 195 $({countNum: 0}).animate({countNum: percentage}, { 196 duration: 2000, 197 easing:'linear', 198 step: function() { 199 // What todo on every count 200 var pct = ''; 201 if(percentage == 0){ 202 pct = Math.floor(this.countNum) + '%'; 203 }else{ 204 pct = Math.floor(this.countNum+1) + '%'; 205 } 206 progress.text(pct); 207 } 208 }); 209 }); 210 211 212/*------------------------------------------------------------------------------*/ 213/* Tab 214/*------------------------------------------------------------------------------*/ 215 216$('.ttm-tabs').each(function() { 217 $(this).children('.content-tab').children().hide(); 218 $(this).children('.content-tab').children().first().show(); 219 $(this).find('.tabs').children('li').on('click', function(e) { 220 var liActive = $(this).index(), 221 contentActive = $(this).siblings().removeClass('active').parents('.ttm-tabs').children('.content-tab').children().eq(liActive); 222 contentActive.addClass('active').fadeIn('slow'); 223 contentActive.siblings().removeClass('active'); 224 $(this).addClass('active').parents('.ttm-tabs').children('.content-tab').children().eq(liActive).siblings().hide(); 225 e.preventDefault(); 226 }); 227}); 228 229 230/*------------------------------------------------------------------------------*/ 231/* Accordion 232/*------------------------------------------------------------------------------*/ 233 234/*https://www.antimath.info/jquery/quick-and-simple-jquery-accordion/*/ 235$(".accordion").each(function(){ 236 237 var allPanels = $('.toggle').children(".toggle-content").hide(); 238 $('.toggle').children(".toggle-content").eq(1).slideDown("easeOutExpo"); 239 $('.toggle').children(".toggle-title").children("a").eq(1).addClass("active"); 240 241 $('.toggle').children(".toggle-title").children("a").on('click', function(){ 242 var current = $(this).parent().next(".toggle-content"); 243 $(".toggle-title > a").removeClass("active"); 244 $(this).addClass("active"); 245 allPanels.not(current).slideUp("easeInExpo"); 246 $(this).parent().next().slideDown("easeOutExpo"); 247 return false; 248 }); 249 250}); 251 252 253/*------------------------------------------------------------------------------*/ 254/* Isotope 255/*------------------------------------------------------------------------------*/ 256 257$(window).on('load', function() { 258 259 var $container = $('#isotopeContainer'); 260 261 // filter items when filter link is clicked 262 $('#filters a').on('click', function(){ 263 var selector = $(this).attr('data-filter'); 264 $container.isotope({ filter: selector }); 265 return false; 266 }); 267 268 var $optionSets = $('#filters li'), 269 $optionLinks = $optionSets.find('a'); 270 271 $optionLinks.on('click', function(){ 272 var $this = $(this); 273 // don't proceed if already selected 274 if ( $this.hasClass('selected') ) { 275 return false; 276 } 277 var $optionSet = $this.parents('#filters'); 278 $optionSet.find('.selected').removeClass('selected'); 279 $this.addClass('selected'); 280 281 // make option object dynamically, i.e. { filter: '.my-filter-class' } 282 var options = {}, 283 key = $optionSet.attr('data-option-key'), 284 value = $this.attr('data-option-value'); 285 // parse 'false' as false boolean 286 value = value === 'false' ? false : value; 287 options[ key ] = value; 288 if ( key === 'layoutMode' && typeof changeLayoutMode === 'function' ) { 289 // changes in layout modes need extra logic 290 changeLayoutMode( $this, options ) 291 } else { 292 // otherwise, apply new options 293 $container.isotope( options ); 294 } 295 296 return false; 297 }); 298 }); 299 300 301/*------------------------------------------------------------------------------*/ 302/* Prettyphoto 303/*------------------------------------------------------------------------------*/ 304/* 305jQuery(document).ready(function(){ 306 307 // Normal link 308jQuery('a[href*=".jpg"], a[href*=".jpeg"], a[href*=".png"], a[href*=".gif"]').each(function(){ 309 if( jQuery(this).attr('target')!='_blank' && !jQuery(this).hasClass('prettyphoto') && !jQuery(this).hasClass('modula-lightbox') ){ 310 var attr = $(this).attr('data-gal'); 311 if (typeof attr !== typeof undefined && attr !== false && attr!='prettyPhoto' ) { 312 jQuery(this).attr('data-rel','prettyPhoto'); 313 } 314 } 315}); 316 317 318jQuery('a[data-gal^="prettyPhoto"]').prettyPhoto(); 319jQuery('a.ttm_prettyphoto').prettyPhoto(); 320jQuery('a[data-gal^="prettyPhoto"]').prettyPhoto(); 321jQuery("a[data-gal^='prettyPhoto']").prettyPhoto({hook: 'data-gal'}) 322 323}); 324*/ 325 326/*------------------------------------------------------------------------------*/ 327/* owlCarousel
328/*------------------------------------------------------------------------------*/ 329 330// =====1: history slide ==== 331 332 $(".history-slide").owlCarousel({ 333 loop:true, 334 margin:0, 335 nav: $('.history-slide').data('nav'), 336 dots: $('.history-slide').data('dots'), 337 autoplay: $('.history-slide').data('auto'), 338 smartSpeed: 3000, 339 responsive:{ 340 0:{ 341 items:1, 342 }, 343 576:{ 344 items:2, 345 }, 346 768:{ 347 items:3 348 }, 349 992:{ 350 items: $('.history-slide').data('item') 351 } 352 } 353 }); 354 355 356// =====2- Team slide ==== 357 358 $(".team-slide").owlCarousel({ 359 loop:true, 360 margin:0, 361 nav: $('.team-slide').data('nav'), 362 dots: $('.team-slide').data('dots'), 363 autoplay: $('.team-slide').data('auto'), 364 smartSpeed: 1000, 365 responsive:{ 366 0:{ 367 items:1, 368 }, 369 480:{ 370 items:2, 371 }, 372 768:{ 373 items:3 374 }, 375 1200:{ 376 items: $('.team-slide').data('item') 377 } 378 } 379 }); 380 381 382// =====3- Testimonial slide ==== 383 384 $(".testimonial-slide").owlCarousel({ 385 loop:true, 386 margin:0, 387 smartSpeed: 1000, 388 nav: $('.testimonial-slide').data('nav'), 389 dots: $('.testimonial-slide').data('dots'), 390 autoplay: $('.testimonial-slide').data('auto'), 391 responsive:{ 392 0:{ 393 items:1, 394 }, 395 600:{ 396 items:1, 397 }, 398 1000:{ 399 items: $('.testimonial-slide').data('item') 400 } 401 } 402 }); 403 404 // ===== 4-Portfolio-slide ==== 405 406$(".portfolio-slide").owlCarousel({ 407 margin: 0, 408 loop:true, 409 nav: $('.portfolio-slide').data('nav'), 410 dots: $('.portfolio-slide').data('dots'), 411 autoplay: $('.portfolio-slide').data('auto'), 412 smartSpeed: 3000, 413 responsive:{ 414 0:{ 415 items:1 416 }, 417 576:{ 418 items:2 419 }, 420 768:{ 421 items:3 422 }, 423 992:{ 424 items:4 425 }, 426 1024:{ 427 items: $('.portfolio-slide').data('item') 428 } 429 } 430}); 431 432 433// ===== 5- Blog slide ==== 434 435 $(".blog-slide").owlCarousel({ 436 loop:true, 437 margin:0, 438 nav: $('.blog-slide').data('nav'), 439 dots: $('.blog-slide').data('dots'), 440 autoplay: $('.blog-slide').data('auto'), 441 smartSpeed: 3000, 442 responsive:{ 443 0:{ 444 items:1, 445 }, 446 576:{ 447 items:2, 448 }, 449 992:{ 450 items: $('.blog-slide').data('item') 451 } 452 } 453 }); 454 455 456// ===== 6- Clients-logo ==== 457 458$(".clients-slide").owlCarousel({ 459 margin: 0, 460 loop:true, 461 nav: $('.clients-slide').data('nav'), 462 dots: $('.clients-slide').data('dots'), 463 autoplay: $('.clients-slide').data('auto'), 464 smartSpeed: 3000, 465 responsive:{ 466 0:{ 467 items:1 468 }, 469 576:{ 470 items:3 471 }, 472 768:{ 473 items:4 474 }, 475 992:{ 476 items: $('.clients-slide').data('item') 477 } 478 } 479}); 480 481// ===== 6- services-slide ==== 482 483$(".services-slide").owlCarousel({ 484 margin: 0, 485 loop:true, 486 nav: $('.services-slide').data('nav'), 487 dots: $('.services-slide').data('dots'), 488 autoplay: $('.services-slide').data('auto'), 489 smartSpeed: 3000, 490 responsive:{ 491 0:{ 492 items:1 493 }, 494 495 680:{ 496 items:2 497 }, 498 992:{ 499 items: $('.services-slide').data('item') 500 } 501 } 502}); 503 504 505 506// =====7- Testimonial slide ==== 507 508 $(".testimonial-slide2").owlCarousel({ 509 loop:true, 510 margin:0, 511 smartSpeed: 1000, 512 nav: $('.testimonial-slide2').data('nav'), 513 dots: $('.testimonial-slide2').data('dots'), 514 autoplay: $('.testimonial-slide2').data('auto'), 515 responsive:{ 516 0:{ 517 items:1, 518 }, 519 576:{ 520 items:2, 521 }, 522 1000:{ 523 items: $('.testimonial-slide2').data('item') 524 } 525 } 526 }); 527 528// ===== 8- portfolio-img-slide ==== 529 530$(".portfolio-img-slide").owlCarousel({ 531 margin: 0, 532 loop:true, 533 nav: $('.portfolio-img-slide').data('nav'), 534 dots: $('.portfolio-img-slide').data('dots'), 535 autoplay: $('.portfolio-img-slide').data('auto'), 536 smartSpeed: 1000, 537 responsive:{ 538 0:{ 539 items:1 540 }, 541 480:{ 542 items:1 543 }, 544 991:{ 545 items:1 546 }, 547 1000:{ 548 items: $('.portfolio-img-slide').data('item') 549 } 550 } 551}); 552 553// ===== 9- project-slide ==== 554 555$(".project-slide").owlCarousel({ 556 margin: 0, 557 loop:true, 558 nav: $('.project-slide').data('nav'), 559 dots: $('.project-slide').data('dots'), 560 autoplay: $('.project-slide').data('auto'), 561 smartSpeed: 1000, 562 responsive:{ 563 0:{ 564 items:1 565 }, 566 480:{ 567 items:1 568 }, 569 991:{ 570 items:1 571 }, 572 1000:{ 573 items: $('.project-slide').data('item') 574 } 575 } 576}); 577 578// ===== 4-Portfolio-slide ==== 579 580$(".portfolio-slide2").owlCarousel({ 581 margin: 0, 582 loop:true, 583 nav: $('.portfolio-slide2').data('nav'), 584 dots: $('.portfolio-slide2').data('dots'), 585 autoplay: $('.portfolio-slide2').data('auto'), 586 smartSpeed: 3000, 587 responsive:{ 588 0:{ 589 items:1 590 }, 591 576:{ 592 items:2 593 }, 594 768:{ 595 items:3 596 }, 597 992:{ 598 items:$('.portfolio-slide2').data('item') 599 } 600 } 601}); 602 603 604jQuery( document ).ready(function($) 605{ 606 if( jQuery('body').hasClass('ttm-one-page-site') ){ 607 var sections = jQuery('.ttm-row'), 608 nav = jQuery('.ttm-header-wrap, .menu'), 609 nav_height = jQuery('#site-navigation').data('sticky-height')-1; 610 611 jQuery(window).on('scroll', function () { 612 if( jQuery('body').scrollTop() < 5 ){ 613 nav.find('a').parent().removeClass('active'); 614 } 615 var cur_pos = jQuery(this).scrollTop(); 616 sections.each(function() { 617 var top = jQuery(this).offset().top - (nav_height+1), 618 bottom = top + jQuery(this).outerHeight(); 619 if (cur_pos >= top && cur_pos <= bottom) { 620 if( typeof jQuery(this) != 'undefined' && typeof jQuery(this).attr('id')!='undefined' && jQuery(this).attr('id')!='' ){ 621 var mainThis = jQuery(this); 622 nav.find('a').removeClass('active'); 623 jQuery(this).addClass('active'); 624 var arr = mainThis.attr('id'); 625 626 // Applying active class 627 nav.find('a').parent().removeClass('active'); 628 nav.find('a').each(function(){ 629 var menuAttr = jQuery(this).attr('href').split('#')[1]; 630 if( menuAttr == arr ){ 631 jQuery(this).parent().addClass('active'); 632 } 633 }) 634 } 635 } 636 }); 637 //} 638 }); 639 640 nav.find('a').on('click', function () { 641 var $el = jQuery(this), 642 id = $el.attr('href'); 643 var arr=id.split('#')[1]; 644 jQuery('html, body').animate({ 645 scrollTop: jQuery('#'+ arr).offset().top - nav_height 646 }, 500); 647 return false;
648 }); 649 650 } 651 652} ); // END of document.ready 653 654 655/*------------------------------------------------------------------------------*/ 656/* Back to top 657/*------------------------------------------------------------------------------*/ 658 659// ===== Scroll to Top ==== 660jQuery('#totop').hide(); 661jQuery(window).scroll(function() { 662 "use strict"; 663 if (jQuery(this).scrollTop() >= 100) { // If page is scrolled more than 50px 664 jQuery('#totop').fadeIn(200); // Fade in the arrow 665 jQuery('#totop').addClass('top-visible'); 666 } else { 667 jQuery('#totop').fadeOut(200); // Else fade out the arrow 668 jQuery('#totop').removeClass('top-visible'); 669 } 670}); 671jQuery('#totop').on('click', function() { // When arrow is clicked 672 jQuery('body,html').animate({ 673 scrollTop : 0 // Scroll to top of body 674 }, 500); 675 return false; 676}); 677 678 679 $(function() { 680 681 }); 682})(jQuery);
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.