1// ------------------------------------------------------------------------------ // 2// 3// Template name : Bootsnav - Multi Purpose Header 4// Categorie : Bootstrap Menu in CSS 5// Author : adamnurdin01 6// Version : v.1.2 7// Created : 2016-06-02 8// Last update : 2016-10-19 9// 10// ------------------------------------------------------------------------------ // 11 12(function ($) { 13 "use strict"; 14 15 var bootsnav = { 16 initialize: function () { 17 this.event(); 18 this.hoverDropdown(); 19 this.navbarSticky(); 20 this.navbarScrollspy(); 21 }, 22 event: function () { 23 24 // ------------------------------------------------------------------------------ // 25 // Variable 26 // ------------------------------------------------------------------------------ // 27 var getNav = $("nav.navbar.bootsnav"); 28 29 // ------------------------------------------------------------------------------ // 30 // Navbar Sticky 31 // ------------------------------------------------------------------------------ // 32 var navSticky = getNav.hasClass("navbar-sticky"); 33 if (navSticky) { 34 // Wraped navigation 35 getNav.wrap("<div class='wrap-sticky'></div>"); 36 } 37 38 // ------------------------------------------------------------------------------ // 39 // Navbar Center 40 // ------------------------------------------------------------------------------ // 41 if (getNav.hasClass("brand-center")) { 42 var postsArr = new Array(), 43 index = $("nav.brand-center"), 44 $postsList = index.find('ul.navbar-nav'); 45 46 index.prepend("<span class='storage-name' style='display:none;'></span>"); 47 48 //Create array of all posts in lists 49 index.find('ul.navbar-nav > li').each(function () { 50 if ($(this).hasClass("active")) { 51 var getElement = $("a", this).eq(0).text(); 52 $(".storage-name").html(getElement); 53 } 54 postsArr.push($(this).html()); 55 }); 56 57 //Split the array at this point. The original array is altered. 58 var firstList = postsArr.splice(0, Math.round(postsArr.length / 2)), 59 secondList = postsArr, 60 ListHTML = ''; 61 62 var createHTML = function (list) { 63 ListHTML = ''; 64 for (var i = 0; i < list.length; i++) { 65 ListHTML += '<li>' + list[i] + '</li>' 66 } 67 } 68 69 //Generate HTML for first list 70 createHTML(firstList); 71 $postsList.html(ListHTML); 72 index.find("ul.nav").first().addClass("navbar-left"); 73 74 //Generate HTML for second list 75 createHTML(secondList); 76 //Create new list after original one 77 $postsList.after('<ul class="nav navbar-nav"></ul>').next().html(ListHTML); 78 index.find("ul.nav").last().addClass("navbar-right"); 79 80 //Wrap navigation menu 81 index.find("ul.nav.navbar-left").wrap("<div class='col-half left'></div>"); 82 index.find("ul.nav.navbar-right").wrap("<div class='col-half right'></div>"); 83 84 //Selection Class 85 index.find('ul.navbar-nav > li').each(function () { 86 var dropDown = $("ul.dropdown-menu", this), 87 //added for center logo header 88 simpleMenu = $("ul.simple-dropdown", this), 89 megaMenu = $("ul.megamenu-content", this); 90 dropDown.closest("li").addClass("dropdown"); 91 simpleMenu.closest("li").addClass("simple-dropdown"); 92 megaMenu.closest("li").addClass("megamenu-fw"); 93 }); 94 95 var getName = $(".storage-name").html(); 96 if (!getName == "") { 97 $("ul.navbar-nav > li:contains('" + getName + "')").addClass("active"); 98 } 99 } 100 101 102 // ------------------------------------------------------------------------------ // 103 // Navbar Sidebar 104 // ------------------------------------------------------------------------------ // 105 if (getNav.hasClass("navbar-sidebar")) { 106 // Add Class to body 107 $("body").addClass("wrap-nav-sidebar"); 108 getNav.wrapInner("<div class='scroller'></div>"); 109 } else { 110 $(".bootsnav").addClass("on"); 111 } 112 113 // ------------------------------------------------------------------------------ // 114 // Menu Center 115 // ------------------------------------------------------------------------------ // 116 if (getNav.find("ul.nav").hasClass("navbar-center")) { 117 getNav.addClass("menu-center"); 118 } 119 120 // ------------------------------------------------------------------------------ // 121 // Navbar Full 122 // ------------------------------------------------------------------------------ // 123 if (getNav.hasClass("navbar-full")) { 124 // Add Class to body 125 $("nav.navbar.bootsnav").find("ul.nav").wrap("<div class='wrap-full-menu'></div>"); 126 $(".wrap-full-menu").wrap("<div class='nav-full'></div>"); 127 $("ul.nav.navbar-nav").prepend("<li class='close-full-menu'><a href='#'><i class='fa fa-times'></i></a></li>"); 128 } else if (getNav.hasClass("navbar-mobile")) { 129 getNav.removeClass("no-full"); 130 } else { 131 getNav.addClass("no-full"); 132 } 133 134 // ------------------------------------------------------------------------------ // 135 // Navbar Mobile 136 // ------------------------------------------------------------------------------ // 137 if (getNav.hasClass("navbar-mobile")) { 138 // Add Class to body 139 $('.navbar-collapse').on('shown.bs.collapse', function () { 140 $("body").addClass("side-right"); 141 }); 142 $('.navbar-collapse').on('hide.bs.collapse', function () { 143 $("body").removeClass("side-right"); 144 }); 145 146 $(window).on("resize", function () { 147 $("body").removeClass("side-right"); 148 }); 149 } 150 151 // ------------------------------------------------------------------------------ // 152 // Navbar Fixed 153 // ------------------------------------------------------------------------------ // 154 if (getNav.hasClass("no-background")) { 155 $(window).on("scroll", function () { 156 var scrollTop = $(window).scrollTop(); 157 if (scrollTop > 34) { 158 $(".navbar-fixed").removeClass("no-background"); 159 } else { 160 $(".navbar-fixed").addClass("no-background"); 161 } 162 }); 163 } 164 165 // ------------------------------------------------------------------------------ // 166 // Navbar Fixed 167 // ------------------------------------------------------------------------------ // 168 if (getNav.hasClass("navbar-transparent")) { 169 $(window).on("scroll", function () { 170 var scrollTop = $(window).scrollTop(); 171 if (scrollTop > 34) { 172 $(".navbar-fixed").removeClass("navbar-transparent"); 173 } else { 174 $(".navbar-fixed").addClass("navbar-transparent"); 175 } 176 }); 177 } 178 179 // ------------------------------------------------------------------------------ // 180 // Button Cart 181 // ------------------------------------------------------------------------------ // 182 $(".btn-cart").on("click", function (e) { 183 e.stopPropagation(); 184 }); 185 186 // ------------------------------------------------------------------------------ // 187 // Toggle Search 188 // ------------------------------------------------------------------------------ // 189 $("nav.navbar.bootsnav .attr-nav").each(function () { 190 $("li.search > a", this).on("click", function (e) { 191 e.preventDefault(); 192 $(".top-search").slideToggle(); 193 }); 194 }); 195 $(".input-group-addon.close-search").on("click", function () {
196 $(".top-search").slideUp(); 197 }); 198 199 // ------------------------------------------------------------------------------ // 200 // Toggle Side Menu 201 // ------------------------------------------------------------------------------ // 202 $("nav.navbar.bootsnav .attr-nav").each(function () { 203 $("li.side-menu > a", this).on("click", function (e) { 204 e.preventDefault(); 205 $("nav.navbar.bootsnav > .side").toggleClass("on"); 206 $("body").toggleClass("on-side"); 207 }); 208 }); 209 $(".side .close-side").on("click", function (e) { 210 e.preventDefault(); 211 $("nav.navbar.bootsnav > .side").removeClass("on"); 212 $("body").removeClass("on-side"); 213 }); 214 215 216 217 // ------------------------------------------------------------------------------ // 218 // Wrapper 219 // ------------------------------------------------------------------------------ // 220 //$("body").wrapInner("<div class='wrapper'></div>"); 221 }, 222 // ------------------------------------------------------------------------------ // 223 // Change dropdown to hover on dekstop 224 // ------------------------------------------------------------------------------ // 225 hoverDropdown: function () { 226 var getNav = $("nav.navbar.bootsnav"), 227 getWindow = $(window).width(), 228 getHeight = $(window).height(), 229 getIn = getNav.find("ul.nav").data("in"), 230 getOut = getNav.find("ul.nav").data("out"); 231 232 if (getWindow < 991) { 233 234 // Height of scroll navigation sidebar 235 $(".scroller").css("height", "auto"); 236 237 // Disable mouseenter event 238 $("nav.navbar.bootsnav ul.nav").find("li.dropdown").off("mouseenter"); 239 $("nav.navbar.bootsnav ul.nav").find("li.dropdown").off("mouseleave"); 240 $("nav.navbar.bootsnav ul.nav").find(".title").off("mouseenter"); 241 $("nav.navbar.bootsnav ul.nav").off("mouseleave"); 242 $(".navbar-collapse").removeClass("animated"); 243 244 // Enable click event 245 $("nav.navbar.bootsnav ul.nav").each(function () { 246 $(".dropdown-menu", this).addClass("animated"); 247 $(".dropdown-menu", this).removeClass(getOut); 248 249 // Dropdown Fade Toggle 250 $("a.dropdown-toggle", this).off('click'); 251 $("a.dropdown-toggle", this).on('click', function (e) { 252 e.stopPropagation(); 253 $(this).closest("li.dropdown").find(".dropdown-menu").first().stop().fadeToggle().toggleClass(getIn); 254 $(this).closest("li.dropdown").first().toggleClass("on"); 255 return false; 256 }); 257 258 // Hidden dropdown action 259 $('li.dropdown', this).each(function () { 260 $(this).find(".dropdown-menu").stop().fadeOut('fast'); 261 $(this).on('hidden.bs.dropdown', function () { 262 $(this).find(".dropdown-menu").stop().fadeOut('fast'); 263 }); 264 return false; 265 }); 266 267 // Megamenu style 268 $(".megamenu-fw", this).each(function () { 269 $(".col-menu", this).each(function () { 270 $(".content", this).addClass("animated"); 271 $(".content", this).stop().fadeOut(); 272 $(".title", this).off("click"); 273 $(".title", this).on("click", function () { 274 $(this).closest(".col-menu").find(".content").stop().fadeToggle('fast').addClass(getIn); 275 $(this).closest(".col-menu").toggleClass("on"); 276 return false; 277 }); 278 279 $(".content", this).on("click", function (e) { 280 e.stopPropagation(); 281 }); 282 }); 283 }); 284 }); 285 286 // Hidden dropdown 287 var cleanOpen = function () { 288 $('li.dropdown', this).removeClass("on"); 289 $(".dropdown-menu", this).stop().fadeOut('fast'); 290 $(".dropdown-menu", this).removeClass(getIn); 291 $(".col-menu", this).removeClass("on"); 292 $(".col-menu .content", this).stop().fadeOut('fast'); 293 $(".col-menu .content", this).removeClass(getIn); 294 } 295 296 // Hidden om mouse leave 297 $("nav.navbar.bootsnav").on("mouseleave", function () { 298 cleanOpen(); 299 }); 300 301 302 // Enable click atribute navigation 303 $("nav.navbar.bootsnav .attr-nav").each(function () { 304 $(".dropdown-menu", this).removeClass("animated"); 305 $("li.dropdown", this).off("mouseenter"); 306 $("li.dropdown", this).off("mouseleave"); 307 $("a.dropdown-toggle", this).off('click'); 308 $("a.dropdown-toggle", this).on('click', function (e) { 309 e.stopPropagation(); 310 $(this).closest("li.dropdown").find(".dropdown-menu").first().stop().fadeToggle(); 311 $(".navbar-toggle").each(function () { 312 $(".fa", this).removeClass("fa-times"); 313 $(".fa", this).addClass("fa-bars"); 314 $(".navbar-collapse").removeClass("in"); 315 $(".navbar-collapse").removeClass("on"); 316 }); 317 }); 318 319 $(this).on("mouseleave", function () { 320 $(".dropdown-menu", this).stop().fadeOut(); 321 $("li.dropdown", this).removeClass("on"); 322 return false; 323 }); 324 }); 325 326 // Toggle Bars 327 $(".navbar-toggle").each(function () { 328 $(this).off("click"); 329 $(this).on("click", function () { 330 $(".fa", this).toggleClass("fa-bars"); 331 $(".fa", this).toggleClass("fa-times"); 332 cleanOpen(); 333 }); 334 }); 335 336 } else if (getWindow > 991) { 337 // Height of scroll navigation sidebar 338 $(".scroller").css("height", getHeight + "px"); 339 340 // Navbar Sidebar 341 if (getNav.hasClass("navbar-sidebar")) { 342 // Hover effect Sidebar Menu 343 $("nav.navbar.bootsnav ul.nav").each(function () { 344 $("a.dropdown-toggle", this).off('click'); 345 $("a.dropdown-toggle", this).on('click', function (e) { 346 e.stopPropagation(); 347 }); 348 349 $(".dropdown-menu", this).addClass("animated"); 350 $("li.dropdown", this).on("mouseenter", function () { 351 $(".dropdown-menu", this).eq(0).removeClass(getOut); 352 $(".dropdown-menu", this).eq(0).stop().fadeIn('fast').addClass(getIn); 353 $(this).addClass("on"); 354 return false; 355 }); 356 357 $(".col-menu").each(function () { 358 $(".content", this).addClass("animated"); 359 $(".title", this).on("mouseenter", function () { 360 $(this).closest(".col-menu").find(".content").stop().fadeIn('fast').addClass(getIn); 361 $(this).closest(".col-menu").addClass("on"); 362 return false; 363 }); 364 }); 365 366 $(this).on("mouseleave", function () { 367 $(".dropdown-menu", this).stop().removeClass(getIn); 368 $(".dropdown-menu", this).stop().addClass(getOut).fadeOut('fast'); 369 $(".col-menu", this).find(".content").stop().fadeOut('fast').removeClass(getIn); 370 $(".col-menu", this).removeClass("on"); 371 $("li.dropdown", this).removeClass("on"); 372 return false; 373 }); 374 }); 375 } else { 376 var isSafari = !!navigator.userAgent.match(/Version\/[\d\.]+.*Safari/); 377 378 // Hover effect Default Menu 379 $("nav.navbar.bootsnav ul.nav").each(function () { 380 $("a.dropdown-toggle", this).off('click'); 381 $("a.dropdown-toggle", this).on('click', function (e) { 382 e.stopPropagation(); 383 }); 384 385 $(".megamenu-fw", this).each(function () { 386 $(".title", this).off("click"); 387 $("a.dropdown-toggle", this).off("click"); 388 $(".content").removeClass("animated"); 389 }); 390 391 $(".dropdown-menu", this).addClass("animated"); 392 393 // user hover on single menu then hide its sibling children menu 394 if( $( '.navbar-left-sidebar' ).length > 0 || $( '.left-nav-sidebar' ).length > 0 ) { 395 396 $("li:not(.dropdown)", this).on("mouseenter", function () { 397 $(this).parent().find('.dropdown-menu').stop().fadeOut('fast'); 398 }); 399 400 $( document ).on( 'click', '.side-left-menu-close.active', function(e) { 401 $( this ).removeClass( 'active' ); 402 }); 403 } 404 405 $("li.dropdown", this).on("mouseenter", function () { 406 var _this = this; 407 408 $( '.side-left-menu-close' ).addClass( 'active' ); 409 410 if( $( '.navbar-left-sidebar' ).length > 0 || $( '.left-nav-sidebar' ).length > 0 ) { 411 412 $(this).parent().find('.dropdown').removeClass("on"); 413 if( $(this).parents('.dropdown-menu').length > 0 ) { // child 414 $(this).parents('.dropdown-menu').find('.dropdown-menu').not( $( '.dropdown-menu', this ) ).stop().fadeOut('fast'); 415 } else { // main 416 $(this).parents('.bootsnav .nav').find('.dropdown-menu').not( $( '.dropdown-menu', this ) ).stop().fadeOut('fast'); 417 $(":not(.second-level)", this).find('.third-level').stop().fadeOut('fast'); 418 } 419 420 if( $(this).parent().hasClass( "second-level" ) ) { 421 $(this).parents( '.navbar-nav' ).addClass( "enter" ); 422 } else if( $( this ).parent().hasClass( "enter" ) ) { 423 $( '.navbar-nav' ).removeClass( "enter" ); 424 } 425 } 426 427 $(".dropdown-menu", this).eq(0).removeClass(getOut); 428 if(isSafari) 429 $(".dropdown-menu", _this).eq(0).stop().fadeIn('fast').addClass(getIn); 430 else 431 $(".dropdown-menu", _this).eq(0).stop().fadeIn('fast').addClass(getIn); 432 $(this).addClass("on"); 433 434 if( $( '.navbar-left-sidebar' ).length > 0 || $( '.left-nav-sidebar' ).length > 0 ) { 435 436 if( $( '.left-nav-sidebar' ).length > 0 ) { 437 var menu_width = $( '.sidebar-part1' ).outerWidth(); 438 menu_width = menu_width + 20; 439 menu_width = menu_width + $( '.left-nav-on .navbar-nav' ).outerWidth(); 440 } else { 441 var menu_width = $( '.navbar-nav' ).outerWidth(); 442 } 443 444 var mainWidth = $(window).width(); 445 setTimeout( function() { 446 447 $( '.dropdown' ).each( function() { 448 if( $( this ).hasClass( 'on' ) ) { 449 menu_width = menu_width + $( '.dropdown-menu li', this ).outerWidth(); 450 } 451 }); 452 $( '.side-left-menu-close' ).width(mainWidth - menu_width); 453 }, 300 ); 454 } 455 return false; 456 }); 457 458 $("li.dropdown", this).on("mouseleave", function () { 459 $(".dropdown-menu", this).eq(0).removeClass(getIn); 460 461 if ( $(".dropdown-menu", this).css("display") == "none" || !( $( '.navbar-left-sidebar' ).length > 0 || $( '.left-nav-sidebar' ).length > 0 ) || $(this).parents( '.bootsnav .nav' ).hasClass( "enter" ) ) { 462 463 if(isSafari) 464 $(".dropdown-menu", this).eq(0).stop().fadeOut('fast').addClass(getOut); 465 else 466 $(".dropdown-menu", this).eq(0).stop().fadeOut('fast').addClass(getOut); 467 468 $(this).removeClass("on"); 469 } 470 471 472 473 if( $( '.navbar-left-sidebar' ).length > 0 || $( '.left-nav-sidebar' ).length > 0 ) { 474 475 $( '.side-left-menu-close' ).addClass( 'active' ); 476 477 if( $( '.left-nav-sidebar' ).length > 0 ) { 478 var menu_width = $( '.sidebar-part1' ).outerWidth(); 479 menu_width = menu_width + 20; 480 menu_width = menu_width + $( '.left-nav-on .navbar-nav' ).outerWidth(); 481 } else { 482 var menu_width = $( '.navbar-nav' ).outerWidth(); 483 } 484 485 var mainWidth = $(window).width(); 486 setTimeout( function() { 487 488 $( '.dropdown' ).each( function() { 489 if( $( this ).hasClass( 'on' ) ) { 490 menu_width = menu_width + $( '.dropdown-menu li', this ).outerWidth(); 491 } 492 }); 493 $( '.side-left-menu-close' ).width( mainWidth - menu_width ); 494 }, 300 ); 495 } 496 }); 497 498 $(this).on("mouseleave", function () { 499 $(".dropdown-menu", this).removeClass(getIn); 500 $( '.side-left-menu-close' ).removeClass( 'active' ); 501 502 if (isSafari) 503 $(".dropdown-menu", this).eq(0).stop().fadeOut('fast').addClass(getOut); 504 else 505 $(".dropdown-menu", this).eq(0).stop().fadeOut('fast').addClass(getOut); 506 $("li.dropdown", this).removeClass("on"); 507 508 if( $( '.navbar-left-sidebar' ).length > 0 || $( '.left-nav-sidebar' ).length > 0 ) { 509 if( $( '.bootsnav .nav' ).hasClass( "enter" ) ) { 510 $( '.bootsnav .nav' ).removeClass( "enter" ); 511 } else { 512 $( '.bootsnav .nav' ).find('.dropdown-menu').fadeOut('fast'); 513 } 514 } 515 516 return false; 517 }); 518 }); 519 } 520 521 // ------------------------------------------------------------------------------ // 522 // Hover effect Atribute Navigation 523 // ------------------------------------------------------------------------------ // 524 $("nav.navbar.bootsnav .attr-nav").each(
524function () { 525 $("a.dropdown-toggle", this).off('click'); 526 $("a.dropdown-toggle", this).on('click', function (e) { 527 e.stopPropagation(); 528 }); 529 530 $(".dropdown-menu", this).addClass("animated"); 531 $("li.dropdown", this).on("mouseenter", function () { 532 $(".dropdown-menu", this).eq(0).removeClass(getOut); 533 $(".dropdown-menu", this).eq(0).stop().fadeIn('fast').addClass(getIn); 534 $(this).addClass("on"); 535 return false; 536 }); 537 538 $("li.dropdown", this).on("mouseleave", function () { 539 $(".dropdown-menu", this).eq(0).removeClass(getIn); 540 $(".dropdown-menu", this).eq(0).stop().fadeOut('fast').addClass(getOut); 541 $(this).removeClass("on"); 542 }); 543 544 $(this).on("mouseleave", function () { 545 $(".dropdown-menu", this).removeClass(getIn); 546 $(".dropdown-menu", this).eq(0).stop().fadeOut('fast').addClass(getOut); 547 $("li.dropdown", this).removeClass("on"); 548 return false; 549 }); 550 }); 551 } 552 553 // ------------------------------------------------------------------------------ // 554 // Menu Fullscreen 555 // ------------------------------------------------------------------------------ // 556 if (getNav.hasClass("navbar-full")) { 557 var windowHeight = $(window).height(), 558 windowWidth = $(window).width(); 559 560 $(".nav-full").css("height", windowHeight + "px"); 561 $(".wrap-full-menu").css("height", windowHeight + "px"); 562 $(".wrap-full-menu").css("width", windowWidth + "px"); 563 564 $(".navbar-collapse").addClass("animated"); 565 $(".navbar-toggle").each(function () { 566 var getId = $(this).data("target"); 567 $(this).off("click"); 568 $(this).on("click", function (e) { 569 e.preventDefault(); 570 $(getId).removeClass(getOut); 571 $(getId).addClass("in"); 572 $(getId).addClass(getIn); 573 return false; 574 }); 575 576 $("li.close-full-menu").on("click", function (e) { 577 e.preventDefault(); 578 $(getId).addClass(getOut); 579 setTimeout(function () { 580 $(getId).removeClass("in"); 581 $(getId).removeClass(getIn); 582 }, 500); 583 return false; 584 }); 585 }); 586 } 587 }, 588 // ------------------------------------------------------------------------------ // 589 // Navbar Sticky 590 // ------------------------------------------------------------------------------ // 591 navbarSticky: function () { 592 var getNav = $("nav.navbar.bootsnav"), 593 navSticky = getNav.hasClass("navbar-sticky"); 594 595 if (navSticky) { 596 597 // Set Height Navigation 598 var getHeight = getNav.height(); 599 $(".wrap-sticky").height(getHeight); 600
601 // Windown on scroll 602 var getOffset = $(".wrap-sticky").offset().top; 603 $(window).on("scroll", function () { 604 var scrollTop = $(window).scrollTop(); 605 if (scrollTop > getOffset) { 606 getNav.addClass("sticked"); 607 } else { 608 getNav.removeClass("sticked"); 609 } 610 }); 611 } 612 }, 613 // ------------------------------------------------------------------------------ // 614 // Navbar Scrollspy 615 // ------------------------------------------------------------------------------ // 616 navbarScrollspy: function () { 617 var navScrollSpy = $(".navbar-scrollspy"), 618 $body = $('body'), 619 getNav = $('nav.navbar.bootsnav'), 620 offset = getNav.outerHeight(); 621 622 if (navScrollSpy.length) { 623 $body.scrollspy({ target: '.navbar', offset: offset }); 624 625 // Animation Scrollspy 626 $('.scroll').on('click', function (event) { 627 event.preventDefault(); 628 629 // Active link 630 $('.scroll').removeClass("active"); 631 $(this).addClass("active"); 632 633 // Remove navbar collapse 634 $(".navbar-collapse").removeClass("in"); 635 636 // Toggle Bars 637 $(".navbar-toggle").each(function () { 638 $(".fa", this).removeClass("fa-times"); 639 $(".fa", this).addClass("fa-bars"); 640 }); 641 642 // Scroll 643 var scrollTop = $(window).scrollTop(), 644 $anchor = $(this).find('a'), 645 $section = $($anchor.attr('href')).offset().top, 646 $window = $(window).width(), 647 $minusDesktop = getNav.data("minus-value-desktop"), 648 $minusMobile = getNav.data("minus-value-mobile"), 649 $speed = getNav.data("speed"); 650 651 if ($window > 992) { 652 var $position = $section - $minusDesktop; 653 } else { 654 var $position = $section - $minusMobile; 655 } 656 657 $('html, body').stop().animate({ 658 scrollTop: $position 659 }, $speed); 660 }); 661 662 // Activate Navigation 663 var fixSpy = function () { 664 var data = $body.data('bs.scrollspy'); 665 if (data) { 666 offset = getNav.outerHeight(); 667 data.options.offset = offset; 668 $body.data('bs.scrollspy', data); 669 $body.scrollspy('refresh'); 670 } 671 } 672 673 // Activate Navigation on resize 674 var resizeTimer; 675 $(window).on('resize', function () { 676 clearTimeout(resizeTimer); 677 var resizeTimer = setTimeout(fixSpy, 200); 678 }); 679 } 680 } 681 }; 682 683 // Initialize 684 $(document).ready(function () { 685 bootsnav.initialize(); 686 }); 687 688 // Reset on resize 689 $(window).on("resize", function () { 690 bootsnav.hoverDropdown(); 691 setTimeout(function () {
692 bootsnav.navbarSticky(); 693 }, 500); 694 695 // Toggle Bars 696 $(".navbar-toggle").each(function () { 697 $(".fa", this).removeClass("fa-times"); 698 $(".fa", this).addClass("fa-bars"); 699 $(this).removeClass("fixed"); 700 }); 701 $(".navbar-collapse").removeClass("in"); 702 $(".navbar-collapse").removeClass("on"); 703 $(".navbar-collapse").removeClass("bounceIn"); 704 }); 705 706} (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.