1jQuery(function ($) { 2 3 'use strict'; 4 5 // Preloader & Masonry 6 // Hide Mobile Menu On Click 7 // Toggle Menu for Mobile 8 // Sticky Nav 9 // MagnificPopup 10 // CounterUp 11 // Parallax Scrolling 12 // Progress Bar 13 // Video Player 14 // Carousel animation 15 16 // ------------------------------------------------------------- 17 // Preloader 18 // ------------------------------------------------------------- 19 20 $(window).on("load", function(){ 21 $('#preloader').fadeOut('slow',function(){$(this).remove();}); 22 $('.tr-masonry-content').masonry({ 23 itemSelector: '.tr-masonry', 24 columnWidth: 0 25 }); 26 }); 27 28 29 // ------------------------------------------------------------- 30 // Hide Mobile Menu On Click 31 // ------------------------------------------------------------- 32 33 menuHide(); 34 function menuHide(){ 35 var windowWidth = $(window).width(); 36 if(windowWidth < 991 ){ 37 $('.navbar-collapse a').on('click', function (){ 38 $('.navbar-collapse').collapse('toggle'); 39 }); 40 } 41 } 42 43 44 // ------------------------------------------------------------- 45 // Toggle Menu for Mobile 46 // ------------------------------------------------------------- 47 48 mobileDropdown (); 49 function mobileDropdown () { 50 if($('.tr-menu').length) { 51 $('.tr-menu .tr-dropdown').append(function () { 52 return '<i class="fa fa-angle-down icon" aria-hidden="true"></i>'; 53 }); 54 $('.tr-menu .tr-dropdown .icon').on('click', function () { 55 $(this).parent('li').children('ul').slideToggle(); 56 }); 57 } 58 } 59 60 // ------------------------------------------------------------- 61 // Sticky Nav 62 // ------------------------------------------------------------- 63 $(window).on("scroll", function(){ 64 var navbar = $('.navbar'); 65 var $this = $(this); 66 67 if($this.scrollTop() > 50) { 68 navbar.addClass('menu-bg'); 69 } 70 else { 71 navbar.removeClass('menu-bg'); 72 } 73 }); 74 75 if ( sticky_nav_data.sticky_nav == 'disable' ){ 76 var new_scroll_position = 0; 77 var last_scroll_position; 78 var trNavbar = document.getElementById("tr_navbar"); 79 80 window.addEventListener('scroll', function(e) { 81 last_scroll_position = window.scrollY; 82 83 // Scrolling down 84 if (new_scroll_position < last_scroll_position && last_scroll_position > 80) { 85 trNavbar.classList.remove("slideDown"); 86 trNavbar.classList.add("slideUp"); 87 88 // Scrolling up 89 } else if (new_scroll_position > last_scroll_position) { 90 trNavbar.classList.remove("slideUp"); 91 trNavbar.classList.add("slideDown"); 92 } 93 94 new_scroll_position = last_scroll_position; 95 }); 96 } 97 98 99 // ------------------------------------------------------------- 100 // MagnificPopup 101 // ------------------------------------------------------------- 102 103 $('.video-link').magnificPopup({type:'iframe'}); 104 105 $('.photo-overlay .zoom-icon a').magnificPopup({ 106 type: 'image', 107 gallery:{ 108 enabled:true 109 } 110 }); 111 112 113 // ------------------------------------------------------------- 114 // CounterUp 115 // ------------------------------------------------------------- 116 117 $('.counter span').counterUp({ 118 delay: 10, 119 time: 1000 120 }); 121 122 // ------------------------------------------------------------- 123 // Parallax Scrolling 124 // ------------------------------------------------------------- 125 126 $('.tr-parallax').jarallax({ 127 keepImg: true, 128 type: 'scroll-opacity', 129 130 }); 131 132 // ------------------------------------------------------------- 133 // Video Player 134 // ------------------------------------------------------------- 135 136 $("#tr-video-player").YTPlayer({ 137 containment:'self', 138 showControls:false, 139 optimizeDisplay:true 140 141 }); 142 143 /*==============================================================*/ 144 // Carousel animation 145 /*==============================================================*/ 146 147 (function( $ ) { 148 149 function doAnimations( elems ) { 150 var animEndEv = 'webkitAnimationEnd animationend'; 151 152 elems.each(function () { 153 var $this = $(this), 154 $animationType = $this.data('animation');
155 $this.addClass($animationType).one(animEndEv, function () { 156 $this.removeClass($animationType); 157 }); 158 }); 159 } 160 var $myCarousel = $('#tr-carousel'), 161 $firstAnimatingElems = $myCarousel.find('.item:first').find("[data-animation ^= 'animated']"); 162 $myCarousel.carousel(); 163 164 doAnimations($firstAnimatingElems); 165 $myCarousel.carousel('pause'); 166 167 $myCarousel.on('slide.bs.carousel', function (e) { 168 var $animatingElems = $(e.relatedTarget).find("[data-animation ^= 'animated']"); 169 doAnimations($animatingElems); 170 }); 171 172 })(jQuery); 173 174 $('.comment-reply-link').on('click', function(){ 175 $('.tr-comment-form').hide(); 176 }); 177 178 $('a#cancel-comment-reply-link').on('click', function(){ 179 $('.tr-comment-form').show(); 180 }); 181 182// script end 183});
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.