PageSourceSearch

https://www.coloradosleepapnea.com/assets/js/scripts.js

js coloradosleepapnea.com collected 2026-10-04 21:25:41 UTC 10,307 bytes, 293 lines download raw bytes

1$(window).ready(function () {�
2    var interval = setInterval(function () {�
3        if (window.location.hash) window.location = window.location.hash;�
4    }, 0);�
5    setTimeout(function () {�
6        clearInterval(interval);�
7    }, 1000);�
8�
9    function scrollToAnchor(target) {�
10        var $target = $("a[name='" + target.substr(1) + "']"),�
11            targetName = window.location.href.split("#")[1];�
12        $('html, body').stop().animate({�
13            'scrollTop': $target.offset().top�
14        }, 1000, function () {�
15            document.location.hash = targetName;�
16        });�
17    }�
18    $('a[href*="#"]').not('[href="#"]').not('[href="#0"]').click(function (event) {�
19        if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {�
20            var target = $(this.hash);�
21            target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');�
22            if (target.length) {�
23                $('html, body').animate({�
24                    scrollTop: target.offset().top�
25                }, 1000, function () {});�
26            }�
27        }�
28    });�
29});�
30�
31�
32�
33$(function(){�
34�
35�
36  $('header nav').meanmenu({�
37      meanMenuContainer: 'header .place-nav',�
38      meanMenuOpen: "<i class='icon-menu'></i>",�
39      meanMenuClose: "<i class='icon-plus'></i>",�
40      meanScreenWidth: 860,�
41      meanDisplay: "block"�
42  });�
43�
44    $("[data-player]").tntvideos({    �
45      playButton: '.play',�
46      closeButton: '.close',�
47      bodyPlaying: '.playing',�
48      mobileWidth: 900,�
49      offset: 0�
50    });      �
51�
52  $("a[rel*=leanModal]").leanModal();�
53   $(".modal-close").on("click", function(){�
54          for (var i = 0; i < $('.modal-content .youtube iframe').length; i++) {�
55            var video = $('.modal-content .youtube iframe').attr("src");�
56            var video = video.replace("autoplay=1", "autoplay=0") ;�
57            $('.modal-content youtube iframe').attr("src","");�
58            $('.modal-content .youtube iframe').attr("src",video);�
59          }�
60  });�
61  $(".more-to-explore, .page-divider, .services-grid-container").appendTo($(".more-to-explore-container"));�
62  $("main > h1:first-child, h2#append").appendTo($("#page-title .title-wrapper"));�
63  $( "header nav ul li" ).has( "> ul" ).addClass('has-children');�
64  if ($(".main-img").length > 0){�
65    $("#page-title").addClass("flex");�
66    $(".main-img").insertAfter(".title-wrapper");�
67  } else {�
68    $("#page-title").addClass("bg");�
69  }�
70�
71  //activate google map�
72  $(".gmap").on("mouseenter",function(){�
73    $(this).addClass("active");�
74  }).on("mouseleave",function(){�
75    $(this).removeClass("active");�
76  });�
77�
78  // tabitha's fixed header with calc of header�
79�
80  var theWindow = $(window),�
81      body = $("body"),�
82      banner = $("#banner, #page-title .title-wrapper"),�
83      header = $("header"),�
84      headerBottom = header.outerHeight(),�
85      hideBottom = $("header article").outerHeight();�
86�
87      if (theWindow.width() > 861) {�
88        $(window).resize(function () {�
89            banner.css('padding-top', header.outerHeight());�
90        });�
91        banner.css('padding-top', headerBottom);�
92    } else {�
93      $(window).resize(function () {�
94          body.css('padding-top', header.outerHeight());�
95      });�
96      body.css('padding-top', headerBottom);�
97    }�
98�
99      if (window.location.hash && theWindow.width() > 999) {�
100      body.addClass("scrolled");�
101      header.addClass("animated fadeInDown");�
102  }�
103�
104  theWindow.on("scroll", function () {�
105      if (theWindow.width() > 999) {�
106          if (theWindow.scrollTop() >= headerBottom) {�
107              body.addClass("scrolled").removeClass("not-scrolled");�
108              header.addClass("animated fadeInDown");�
109          } else if (theWindow.scrollTop() <= headerBottom) {�
110              body.removeClass("scrolled").addClass("not-scrolled");�
111              header.removeClass("animated fadeInDown");�
112          }�
113      }�
114      if (theWindow.width() < 861) {�
115          if (theWindow.scrollTop() >= hideBottom) {�
116              body.addClass('attach');�
117          } else if (theWindow.scrollTop() <= hideBottom) {�
118              body.removeClass('attach');�
119          }�
120      }�
121  });�
122�
123  // Social and Hours to mobile nav�
124�
125    if ($(window).width() <= 860) {�
126  $("footer .social").clone().prependTo(".mean-container .mean-nav");�
127  $("footer .hours").clone().appendTo(".mean-container .mean-nav");�
128    }�
129�
130�
131    $(".hover-change").on("mouseover", function() {�
132        var $this = $(this);�
133        $this.data("original", $this.attr("src"));�
134        $this.attr("src", $this.data("hover"));�
135    }).on("mouseleave", function() {�
136        var $this = $(this);�
137        $this.data("hover", $this.attr("src"));�
138        $this.attr("src", $this.data("original"));�
139    });�
140�
141�
142  ////////////////////////////// accordion + youtube video api reload on close if playing�
143  $(".accordion h3, .accordion h2").addClass("toogle");�
144  $(".toogle").each(function () {�
145      $(this).nextUntil('.toogle').add().wrapAll('<div>');�
146  });�
147  $(".toogle").on("click", function () {�
148      if ($(this).hasClass("active")) {�
149          $(this).removeClass("active").next().slideUp();�
150      } else {�
151          $(".toogle").removeClass("active").next().slideUp();�
152          $(this).addClass("active").next().slideDown();�
153          for (var i = 0; i < $('.accordion iframe').length; i++) {�
154              $('.accordion iframe')[i].contentWindow.postMessage('{"event":"command","func":"' + 'stopVideo' + '","args":""}', '*');�
155          }�
156      }�
157  });�
158�
159�
160  var slideshows = $('.cycle-slideshow').on('cycle-prev cycle-next', function(e, opts) {�
161      // advance the other slideshow�
162      slideshows.not(this).cycle('goto', opts.currSlide);�
163  });�
164�
165  $('#carousel .cycle-slideshow figure').click(function () {�
166      console.log("clicked");�
167      var index = $('#carousel .cycle-slideshow').data('cycle.API').getSlideIndex(this);�
168      slideshows.cycle('goto', index);�
169  });�
170�
171    ////////////////////////////// page divider�
172    var dividerStart = "> h2, .page-divider .wrap, .page-divider .title",�
173        mobileWidth = 630;�
174    $.when(setupServices()).done(function () {});�
175�
176�
177    function setupServices() {�
178        $(".page-divider " + dividerStart)�
179            .addClass("divider-title").each(function () { //auto wrap �
180                $(this)�
181                    .nextUntil('.divider-title')�
182                    .addBack()�
183                    .wrapAll('<div class="divider-body clearfix">');�
184            });�
185�
186�
187�
188�
189�
190            //if has image�
191         $(".divider-body").each(function (index) {�
192          if ($(window).width() >= mobileWidth) {�
193             $(this)�
194                 .find(">img, p > img, .fluid-vid, .internal-affil, div.elem-left")�
195                 .removeClass('elem-left elem-border')�
196                 .insertAfter($(this).find(">*:last-child"))�
197                 .wrap('<figure class="divider-figure">');�
198             $(".divider-body .fluid-vid").parent(".elem").addClass('vid');�
199�
200             $(this)�
201              .find(".divider-title")�
202              .nextUntil("figure")�
203              .addBack()�
204              .wrapAll('<article class="divider-text"><div>');�
205�
206              $(this)�
207                .find(".divider-title")�
208                .nextAll()�
209                .wrapAll('<div class="line">');�
210            }�
211�
212         });�
213�
214         $(".divider-flex").each(function() {�
215           $(this).insertAfter($(this).closest($(".divider-body")));�
216         });�
217�
218�
219�
220            �
221�
222�
223            // Auto Alternate images�
224             $(".divider-body .divider-figure").each(function(index){�
225                 if (index % 2 === 0){�
226                   $(this).addClass('figure-right');�
227                 }�
228             });�
229  $(".divider-body").each(function(index){�
230    if ( $(this).find("figure").length === 0 ){�
231      $(this).addClass("no-img");�
232    }�
233  });�
234      �
235      �
236              //move anchors to page-divider-body�
237              $(".page-divider a[name]").each(function(){              �
238              var getAnchor = $(this).parent(),�
239                anchorTarget = $(this)�
240                  .parentsUntil(".page-divider")�
241                  .next()�
242                  .find(".divider-title").parent();�
243                getAnchor.prependTo(anchorTarget);�
244              });   �
245            } �
246  });�
247�
248�
249�
250$(window).ready(function() {�
251   let theWindow = $(window);�
252�
253  //// Wraps toggles' H3 into clearfixed sections and moves the image infront of the H3 on desktop�
254  $(".section-toggle h3").each(function() {�
255    $(this).nextUntil('h3, div, h2').addBack().wrapAll('<div class="has-h3">');�
256  });�
257�
258  if ($(window).width() > 750) {�
259    $(".has-h3").each(function(index) {�
260      $(this).find(".elem-left").insertBefore($(this).children("h3"));�
261    })�
262  }�
263�
264�
265/*** Appends the section toggle to the block or pd-body container that is often flexed. This way the toggle content �
266     can fill up the whole width instead of just half screen�
267     May need to change "block" or "divider-body" to whatever the page-divider script is naming the sections �
268  ****///�
269  �
270  �
271$(".block, .divider-body, .pd-block").each(function (index)  {�
272        $(this).find('.section-toggle').appendTo($(this));�
273   });�
274�
275$(".section-toggle").closest('.block, .divider-body').css("flex-wrap", "wrap");�
276�
277  $("button.togg").each(function ()  {�
278     this.setAttribute('aria-expanded', "false");�
279     });�
280  �
281  $("button.togg").on("click", function() {�
282    if ($(this).hasClass("active")) {�
283      this.setAttribute('aria-expanded', "false");�
284       $(this).removeClass("active").closest('.block, .divider-body, .pd-block').find(".section-toggle").slideUp();�
285    } else {�
286       this.setAttribute('aria-expanded', "true");�
287�
288      $(this).addClass("active").closest('.block, .divider-body, .pd-block').find(".section-toggle").slideDown();�
289�
290    }�
291  });�
292�
293});

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.