PageSourceSearch

https://www.morrisinsurance.org/files/theme/custom.js

js morrisinsurance.org collected 2026-10-08 21:27:06 UTC 3,417 bytes, 103 lines download raw bytes

1jQuery(function() {
2    
3	var $ = jQuery;
4    
5  $('body').addClass('postload');
6
7
8    $(document).ready(function() {
9
10    
11        // Mobile menu
12        
13        $(".hamburger").click(function(){
14          $("body").toggleClass("menu-open");
15        });
16        
17        
18        // Sticky Nav Collapse
19        $('body:not(.splash-page)').waypoint(function() {
20          $(this).toggleClass('collapse');
21        }, { offset: -150 });
22        
23        $('body:not(.splash-page) #main-content').css({"padding-top" : $("#header-wrap").height() + "px"});
24      	
25      	// --------------------------------------------------------------------------------------//
26        
27        // Add fullwidth class to gallery thumbs if less than 6
28
29      	$('.imageGallery').each(function(){
30      	  if ($(this).children('div').length <= 6) {
31      	    $(this).children('div').addClass('fullwidth-mobile');
32      	  }
33      	});
34          	
35        // --------------------------------------------------------------------------------------//
36        
37        // Add current class to store gallery thumb
38        
39        $("#wsite-com-product-images-strip a:first").addClass("current");
40
41        $("#wsite-com-product-images-strip a").click(function(){
42          $(".current").removeClass("current");
43          $(this).addClass("current");
44        });
45        
46        // --------------------------------------------------------------------------------------//
47        
48        // Add swipe to fancybox mobile 
49
50        var swipeGallery = function(){
51          setTimeout(function(){
52          var touchGallery = document.getElementsByClassName("fancybox-wrap")[0];
53          var mc = new Hammer(touchGallery);
54          mc.on("panleft panright", function(ev) {
55            if (ev.type == "panleft") {
56              $("a.fancybox-next").trigger("click");
57            }
58            else if (ev.type == "panright") {
59              $("a.fancybox-prev").trigger("click");
60            }
61            swipeGallery();
62          });
63          }, 500);
64        }
65        if ('ontouchstart' in window) {
66          $("body").on( "click", "a.w-fancybox", function() {
67            swipeGallery();
68          });
69      	}
70
71        
72        // --------------------------------------------------------------------------------------//
73      
74        // Watch for changes on non-mobile nav
75
76        if ($(window).width() < 768) {
77
78          var mainNav = '#nav',
79              mobileNav = "#navmobile";
80
81          $(mainNav).on('DOMSubtreeModified propertychange', function() {
82            $(mainNav + " li a").each(function(){
83              // Differentiating post-load nav elements by the presence of an id
84              if ($(this).attr("id") && $(this).attr("id") != "wsite-nav-cart-a") {
85                var navLinkId = $(this).attr("id");
86                var navLinkParent = $(this).parent().detach();
87
88                // Append to mobile nav if new element
89                if (!$(mobileNav + " #"+navLinkId).length) {
90                  $(mobileNav + " .wsite-menu-default").append(navLinkParent);
91                  var newheight = $(mobileNav + " .wsite-menu-default").height();
92                  $(".wsite-mobile-menu").height(newheight);
93                }
94              }
95            });
96          });          
97        }
98
99        // --------------------------------------------------------------------------------------//
100      
101    });
102});
103

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.