PageSourceSearch

https://www.draperinc.com/meganavbarbs4/assets/js/meganavbarbs4.js

js draperinc.com collected 2026-09-25 14:07:36 UTC 3,383 bytes, 71 lines download raw bytes

1/* MegaNavbar BS4 v1.0.2 (http://www.Navbar4.com/) Copyright 2018 www.Navbar4.com. All Rights Reserved.
2** Licensed under Regular License (http://codecanyon.net/licenses/regular) or Extended License (http://codecanyon.net/licenses/extended)
3** We will take legal action against those who copy our HTML content, CSS style sheets and JavaScript functions without a license.*/
4
5$( document ).ready(function() {
6
7  //Correct display of active and open arrows.
8  $('.navbar .dropdown-menu').on('show.bs.collapse  hidden.bs.collapse', function (event) {
9    event.stopPropagation();
10    (event.type=='show')?$(this).parent().addClass('show'):$(this).parent().removeClass('show');
11  });
12
13  //Close a menu by clicking anywhere on the document.
14  $(document).on('click', function (e) {
15    if (!$(e.target).closest('.dropdown-menu').length)  {
16      $('.navbar .dropdown-menu.collapse.show, .navbar .dropdown-menu.collapsing').collapse('hide');
17    }
18  });
19
20  //Close all submenus if the parent menu is closed.
21  $('.navbar .dropdown-menu').on('hidden.bs.collapse', function (event) {
22    event.stopPropagation();
23    $(this).find('.collapse.show').each(function () {$(this).collapse('hide');});
24  });
25
26  //Close a menu by clicking on other menu item.
27  $('.navbar .dropdown-menu').on('show.bs.collapse shown.bs.collapse', function (event) {
28    event.stopPropagation();
29    $(this).parent().siblings('.show').children('.dropdown-menu').collapse('hide');
30  });
31
32  //How to fix MegaNavbar menu when scrolling page
33  var target=$('.navbar'), offset = target.offset().top;
34  $(window).scroll(function() {
35    if (!$('.navbar').is('.fixed-onscroll')) return false;
36    if ($(window).scrollTop() >= offset) {target.addClass('fixed-top'); $('body').css({'margin-top': target.height()+'px'});}
37    else {target.removeClass('fixed-top'); $('body').css({'margin-top': ''});}
38  });
39
40
41  //Open menu on hover.
42  //Check if not collapsed
43  var CheckHover = function(e) {
44    if (!$('.navbar').is('.navbar-hover')) return false;
45    var w = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
46    return (e.is('.navbar-expand')) ||
47      (e.is('.navbar-expand-xl') && w >= 1200) || (e.is('.navbar-expand-lg') && w >= 992) ||
48      (e.is('.navbar-expand-md') && w >= 768) ||  (e.is('.navbar-expand-sm') && w >= 576);
49  }
50
51  //Prevent click if hover
52  $('.navbar [data-toggle="collapse"]').on( "click", function(e) {if (CheckHover($(this.closest('.navbar')))) {e.preventDefault(); e.stopPropagation();}});
53
54  $('.navbar [class*="drop"]').hover(
55    function() {
56      if (!CheckHover($(this.closest('.navbar')))) return;
57      $(this).children('.dropdown-menu').collapse('show').on('shown.bs.collapse.hover', function (e) {
58        if (!$(this).parent(':hover').length) {$(this).collapse('hide').parent().removeClass('show');}
59        $(this).off('shown.bs.collapse.hover');
60      }).parent().addClass('show');
61    },
62    function() {
63      if (!CheckHover($(this.closest('.navbar')))) return;
64      $(this).children('.dropdown-menu').collapse('hide').on('hidden.bs.collapse.hover', function (e) {
65        if ($(this).parent(':hover').length) {$(this).collapse('show').parent().addClass('show');}
66        $(this).off('hidden.bs.collapse.hover');
67      }).parent().removeClass('show');
68    }
69  );
70
71});

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.