PageSourceSearch

https://www.alliancehealthplan.org/wp-content/themes/alliancehealt…tom_homepage-transitional.js?ver=2104284334

js alliancehealthplan.org collected 2026-09-26 12:44:27 UTC 5,425 bytes, 218 lines download raw bytes

1jQuery(document).ready(function($) {
2
3
4
5
6	var headerImage = '';
7
8
9	/**
10	 *
11	 */
12	$(window).on('resize', function() {
13
14		if (typeof heroImage === 'undefined' || typeof heroImageMobile === 'undefined') {
15			return false;
16		}
17
18		var win = $(this);
19		if (win.width() <= 768) {
20			headerImage = heroImageMobile;
21		} else {
22			headerImage = heroImage;
23		}
24		$('#tp-home-hero-area').css('background-image', 'url(' + headerImage + ')');
25	});
26
27
28	/**
29	 *
30	 */
31	if ($(window).width() <= 768 && typeof heroImage !== 'undefined' && typeof heroImageMobile !== 'undefined') {
32		headerImage = heroImageMobile;
33	} else if ($(window).width() > 768 && typeof heroImage !== 'undefined' && typeof heroImageMobile !== 'undefined') {
34		headerImage = heroImage;
35	}
36
37
38	/**
39	 * Assigns an image to an <img> tag and then transfers it a a div background.
40	 * This tries to solve the issue of the hero letter appear before the image is loaded.
41	 */
42	if (headerImage != '') {
43		$('<img/>').attr('src', headerImage).on('load', function() {
44			$(this).remove();
45			$('#tp-home-hero-area').css('background-image', 'url(' + headerImage + ')');
46			$('#tp-home-hero-area .tp-home-hero-content .hero-text').fadeIn('slow');
47		});	
48	}
49
50	/* swiper */
51
52    var swiper = new Swiper(".mySwiper", {
53      
54      slidesPerView: "auto",
55      spaceBetween: 30,
56      pagination: {
57        el: ".swiper-pagination",
58        clickable: true,
59      },
60      autoHeight: true,
61      grabCursor: true,
62      loop: true,
63      //loopedSlides: 3,
64
65
66
67    });
68  
69	/* carousel */
70	$('.carousel-item', '.show-neighbors').each(function(){
71	  var next = $(this).next();
72	  if (! next.length) {
73	    next = $(this).siblings(':first');
74	  }
75	  next.children(':first-child').clone().appendTo($(this));
76	}).each(function(){
77	  var prev = $(this).prev();
78	  if (! prev.length) {
79	    prev = $(this).siblings(':last');
80	  }
81	  //prev.children(':nth-last-child(2)').clone().prependTo($(this));
82	});
83
84
85
86	$('.column-links-desctop .column-links-wrap').on('click', function (e) {
87		var a = $(this).find('div.column-links-footer a').attr('href');
88		window.open(a, '_blank');
89	});
90
91
92
93	/* collapse section */
94	$('#collapseInfo').on('show.bs.collapse', function () {
95	  $('.grad-col').addClass('show-collapse');
96	});
97	$('#collapseInfo').on('hide.bs.collapse', function () {
98	  $('.grad-col').removeClass('show-collapse');
99	});
100	$('#collapseInfo-mobile').on('show.bs.collapse', function () {
101	  $('#info-collaps-wrap-mobile .grad-col').addClass('show-collapse-m');
102	});
103	$('#collapseInfo-mobile').on('hide.bs.collapse', function () {
104	  $('#info-collaps-wrap-mobile .grad-col').removeClass('show-collapse-m');
105	});
106
107	/* sticky top navbar */
108    var $document, didScroll, offset;
109    offset = $('.nav_sticky').position().top;
110
111    $document = $(document);
112    didScroll = false;
113    $(window).on('scroll touchmove', function() {
114      return didScroll = true;
115    });
116
117
118	/* sticky collapse sections */
119    var $document1, didScroll1, offset1;
120    //offset1 = $('#info-collaps-wrap').position().top;
121    var gerywrap = document.getElementById('gery-wrap').getBoundingClientRect();
122    
123    $document1 = $(document);
124    didScroll1 = false;
125    $(window).on('scroll touchmove', function() {
126      return didScroll1 = true;
127    });
128
129   /* sticky collapse sections mobile */
130    var $document2, didScroll2, offset2, offset3;
131    offset2 = $('#info-collaps-wrap-mobile').position().top;
132    offset3 = $('#info-collaps-wrap-mobile-fake').position().top;
133    
134
135
136
137    $document2 = $(document);
138    didScroll2 = false;
139    $(window).on('scroll touchmove', function() {
140      return didScroll2 = true;
141    });
142
143
144    return setInterval(function() {
145
146    	/* sticky top navbar */
147      if (didScroll) {
148        $('.nav_sticky').toggleClass('nav_fixed', $document.scrollTop() > offset);
149        return didScroll = false;
150      }  
151
152      /* sticky collapse sections */
153      if (didScroll1) {
154
155
156	        var scrollBottom_page = $(window).scrollTop() + $(window).height();
157	        var bottom_gerywrap = gerywrap.top + 200;
158
159	        $('#info-collaps-wrap').toggleClass('collaps_fixed', scrollBottom_page > bottom_gerywrap );
160
161	        // console.log( bottom_gerywrap );
162	        // console.log( scrollBottom_page );
163
164
165	        if ( scrollBottom_page > (bottom_gerywrap + 80 ) ) {
166						$('#collapseInfo').collapse('show');
167	        } else {
168	        	$('#collapseInfo').collapse('hide');
169	        }
170	        
171	        return didScroll1 = false;
172      }
173
174      /* sticky collapse sections mobile */
175      if (didScroll2) {
176
177
178	        var aprox2 = 562;
179
180
181	        $('#info-collaps-wrap-mobile').toggleClass('collaps_fixed', $document2.scrollTop() > (offset3 -  aprox2) );
182	        //console.log( $document2.scrollTop() );
183	        //console.log(offset2 -  aprox2);
184	        //console.log(offset3);
185
186	        if ( $document2.scrollTop() > (offset3 -  aprox2 + 80 ) ) {
187						$('#collapseInfo-mobile').collapse('show');
188	        } else {
189	        	$('#collapseInfo-mobile').collapse('hide');
190	        }
191	        
192	        return didScroll2 = false;
193      }
194
195
196    }, 10);
197
198
199
200	/* Draggable Bootstrap Slider carousel */
201	$(".carousel").swipe({
202      swipe: function (event, direction, distance, duration, fingerCount, fingerData) {
203          if (direction == 'left') $(this).carousel('next');
204          if (direction == 'right') $(this).carousel('prev');
205      },
206      allowPageScroll: "vertical" 
207  });		
208
209
210
211});
212
213
214
215
216
217
218

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.