1/* 2=========================================================================== 3 EXCLUSIVE ON themeforest.net 4~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 Template Name : Mobiom 6 Author : PxDraft 7~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 8 Copyright (c) 2017 - 9=========================================================================== 10*/ 11 12(function($){ 13 "use strict"; 14 var MOBI = {}; 15 var plugin_track = 'static/plugin/index.html'; 16 $.fn.exists = function () { 17 return this.length > 0; 18 }; 19 20 /* ---------------------------------------------- /* 21 * Pre load 22 /* ---------------------------------------------- */ 23 MOBI.PreLoad = function() { 24 document.getElementById("loading").style.display = "none"; 25 } 26 27 /*-------------------- 28 * Menu Close 29 ----------------------*/ 30 MOBI.MenuClose = function(){ 31 $('.navbar-nav .nav-link').on('click', function() { 32 var toggle = $('.navbar-toggler').is(':visible'); 33 if (toggle) { 34 $('.navbar-collapse').collapse('hide'); 35 } 36 }); 37 } 38 39 40 /* ---------------------------------------------- /* 41 * Header Fixed 42 /* ---------------------------------------------- */ 43 MOBI.HeaderFixd = function() { 44 var HscrollTop = $(window).scrollTop(); 45 if (HscrollTop >= 100) { 46 $('header').addClass('fixed-header'); 47 } 48 else { 49 $('header').removeClass('fixed-header'); 50 } 51 } 52 53 /*-------------------- 54 * One Page 55 ----------------------*/ 56 MOBI.OnePage = function(){ 57 $('header a[href*="#"]:not([href="#"]), .got-to a[href*="#"]:not([href="#"])').on('click', function() { 58 if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') || location.hostname == this.hostname) { 59 var target = $(this.hash); 60 target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); 61 if (target.length) { 62 $('html,body').animate({ 63 scrollTop: target.offset().top - 70, 64 }, 1000); 65 return false; 66 } 67 } 68 }); 69 } 70 71 72 /* ---------------------------------------------- /* 73 * Mega Menu 74 /* ---------------------------------------------- */ 75 76 MOBI.MegaMenu = function() { 77 var mDropdown = $(".m-dropdown-toggle") 78 mDropdown.on("click", function() { 79 $(this).parent().toggleClass("open-menu-parent"); 80 $(this).next('ul').toggleClass("open-menu"); 81 $(this).toggleClass("open"); 82 }); 83 } 84 /* ---------------------------------------------- /* 85 * accordion 86 /* ---------------------------------------------- */ 87 MOBI.Accordion = function() { 88 $('.accordion').each(function (i, elem) { 89 var $elem = $(this), 90 $acpanel = $elem.find(".acco-group > .acco-des"), 91 $acsnav = $elem.find(".acco-group > .acco-heading"); 92 $acpanel.hide().first().slideDown("easeOutExpo"); 93 $acsnav.first().parent().addClass("acco-active"); 94 $acsnav.on('click', function () { 95 if(!$(this).parent().hasClass("acco-active")){ 96 var $this = $(this).next(".acco-des"); 97 $acsnav.parent().removeClass("acco-active"); 98 $(this).parent().addClass("acco-active"); 99 $acpanel.not($this).slideUp("easeInExpo"); 100 $(this).next().slideDown("easeOutExpo"); 101 }else{ 102 $(this).parent().removeClass("acco-active"); 103 $(this).next().slideUp("easeInExpo"); 104 } 105 return false; 106 }); 107 }); 108 } 109 110 /*-------------------- 111 * Counter JS 112 ----------------------*/ 113 MOBI.Counter = function () { 114 var counter = jQuery(".counter"); 115 var $counter = $('.counter'); 116 if(counter.length > 0) { 117 loadScript(plugin_track + 'counter/jquery.countTo.js', function() { 118 $counter.each(function () { 119 var $elem = $(this);
120 $elem.appear(function () { 121 $elem.find('.count').countTo({ 122 speed: 2000, 123 refreshInterval: 10 124 }); 125 }); 126 }); 127 }); 128 } 129 } 130 131 132 /*-------------------- 133 * OwlSlider 134 ----------------------*/ 135 MOBI.Owl = function () { 136 var owlslider = jQuery("div.owl-carousel"); 137 if(owlslider.length > 0) { 138 loadScript(plugin_track + 'owl-carousel/js/owl.carousel.min.js', function() { 139 owlslider.each(function () { 140 var $this = $(this), 141 $items = ($this.data('items')) ? $this.data('items') : 1, 142 $loop = ($this.attr('data-loop')) ? $this.data('loop') : true, 143 $navdots = ($this.data('nav-dots')) ? $this.data('nav-dots') : false, 144 $navarrow = ($this.data('nav-arrow')) ? $this.data('nav-arrow') : false, 145 $autoplay = ($this.attr('data-autoplay')) ? $this.data('autoplay') : true, 146 $autospeed = ($this.attr('data-autospeed')) ? $this.data('autospeed') : 5000, 147 $smartspeed = ($this.attr('data-smartspeed')) ? $this.data('smartspeed') : 1000, 148 $autohgt = ($this.data('autoheight')) ? $this.data('autoheight') : false, 149 $CenterSlider = ($this.data('center')) ? $this.data('center') : false, 150 $space = ($this.attr('data-space')) ? $this.data('space') : 30; 151 152 $(this).owlCarousel({ 153 loop: $loop, 154 items: $items, 155 responsive: { 156 0:{items: $this.data('xx-items') ? $this.data('xx-items') : 1}, 157 480:{items: $this.data('xs-items') ? $this.data('xs-items') : 1}, 158 768:{items: $this.data('sm-items') ? $this.data('sm-items') : 2}, 159 980:{items: $this.data('md-items') ? $this.data('md-items') : 3}, 160 1200:{items: $items} 161 }, 162 dots: $navdots, 163 autoplayTimeout:$autospeed, 164 smartSpeed: $smartspeed, 165 autoHeight:$autohgt, 166 center:$CenterSlider, 167 margin:$space, 168 nav: $navarrow, 169 navText:["<i class='ti-arrow-left'></i>","<i class='ti-arrow-right'></i>"], 170 autoplay: $autoplay, 171 autoplayHoverPause: true 172 }); 173 }); 174 }); 175 } 176 } 177 178 /* ---------------------------------------------- /* 179 * lightbox gallery 180 /* ---------------------------------------------- */ 181 MOBI.Gallery = function() { 182 if ($(".portfolio-item").exists() || $(".popup-youtube, .popup-vimeo, .popup-gmaps").exists()){ 183 loadScript(plugin_track + 'magnific/jquery.magnific-popup.min.js', function() { 184 if($(".portfolio-item").exists()){ 185 $('.portfolio-item').magnificPopup({ 186 delegate: '.gallery-link', 187 type: 'image', 188 tLoading: 'Loading image #%curr%...', 189 mainClass: 'mfp-fade', 190 fixedContentPos: true, 191 closeBtnInside: false, 192 gallery: { 193 enabled: true, 194 navigateByImgClick: true, 195 preload: [0, 1] // Will preload 0 - before current, and 1 after the current image 196 } 197 }); 198 } 199 if ($(".popup-youtube, .popup-vimeo, .popup-gmaps").exists()) { 200 $('.popup-youtube, .popup-vimeo, .popup-gmaps').magnificPopup({ 201 disableOn: 700, 202 type: 'iframe', 203 mainClass: 'mfp-fade', 204 removalDelay: 160, 205 preloader: false, 206 fixedContentPos: false 207 }); 208 } 209 }); 210 } 211 } 212 213 /*-------------------- 214 * Masonry 215 ----------------------*/ 216 MOBI.masonry = function () { 217 var portfolioWork = $('.portfolio-content'); 218 if ($(".portfolio-content").exists()){ 219 loadScript(plugin_track + 'isotope/isotope.pkgd.min.js', function() { 220 if ($(".portfolio-content").exists()){ 221 $(portfolioWork).isotope({ 222 resizable: false, 223 itemSelector: '.portfolio-item', 224 layoutMode: 'masonry', 225 filter: '*' 226 }); 227 //Filtering items on portfolio.html 228 var portfolioFilter = $('.filter li'); 229 // filter items on button click 230 $(portfolioFilter).on( 'click', function() { 231 var filterValue = $(this).attr('data-filter'); 232 portfolioWork.isotope({ filter: filterValue }); 233 }); 234 //Add/remove class on filter list 235 $(portfolioFilter).on( 'click', function() { 236 $(this).addClass('active').siblings().removeClass('active'); 237 }); 238 } 239 }); 240 } 241 } 242 243 /*-------------------- 244 * Tyoe It 245 ----------------------*/ 246 MOBI.mTypeIt = function() { 247 if ($("#type-it").exists()){ 248 loadScript(plugin_track + 'typeit-master/typeit.min.js', function() { 249 new TypeIt('#type-it', { 250 speed: 200, 251 loop:true,
252 strings: [ 253 'Design', 254 'Development' 255 ], 256 breakLines: false 257 }); 258 }); 259 } 260 } 261 262 /*-------------------- 263 * Video Bg 264 ----------------------*/ 265 MOBI.VideoBG = function() { 266 if ($(".video-bg").exists()){ 267 loadScript(plugin_track + 'vide/jquery.vide.min.js', function() { 268 }); 269 } 270 } 271 272 /*----------------------- 273 * Working Contact form 274 -------------------------*/ 275 MOBI.ContactForm = function(){ 276 $(".contactform").on("submit", function() { 277 $(".output_message").text("Loading..."); 278 279 var form = $(this); 280 $.ajax({ 281 url: form.attr("action"), 282 method: form.attr("method"), 283 data: form.serialize(), 284 success: function(result) { 285 if (result == "success") { 286 $(".contactform").find(".output_message").addClass("success"); 287 $(".output_message").text("Message Sent!"); 288 } else { 289 $(".contactform").find(".output_message").addClass("error"); 290 $(".output_message").text("Error Sending!"); 291 } 292 } 293 }); 294 295 return false; 296 }); 297 } 298 299 300 301 /* ---------------------------------------------- /* 302 * All Functions 303 /* ---------------------------------------------- */ 304 // loadScript 305 var _arr = {}; 306 function loadScript(scriptName, callback) { 307 if (!_arr[scriptName]) { 308 _arr[scriptName] = true; 309 var body = document.getElementsByTagName('body')[0]; 310 var script = document.createElement('script'); 311 script.type = 'text/javascript'; 312 script.src = scriptName; 313 // then bind the event to the callback function 314 // there are several events for cross browser compatibility 315 // script.onreadystatechange = callback; 316 script.onload = callback; 317 // fire the loading 318 body.appendChild(script); 319 } else if (callback) { 320 callback(); 321 } 322 }; 323 324 // Window on Load 325 $(window).on("load", function(){ 326 MOBI.PreLoad(); 327 }); 328 // Document on Ready 329 $(document).on("ready", function(){ 330 MOBI.VideoBG(), 331 MOBI.HeaderFixd(), 332 MOBI.OnePage(), 333 MOBI.Accordion(), 334 MOBI.Counter(), 335 MOBI.MenuClose(), 336 MOBI.Gallery(), 337 MOBI.MegaMenu(), 338 MOBI.ContactForm(), 339 MOBI.masonry(), 340 MOBI.mTypeIt(), 341 MOBI.Owl(); 342 343 }); 344 345 // Document on Scrool 346 $(window).on("scroll", function(){ 347 MOBI.HeaderFixd(); 348 }); 349 350 // Window on Resize 351 $(window).on("resize", function(){ 352 }); 353 354 355})(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.