PageSourceSearch

https://www.apdiving.com/en/wp-content/themes/ap/js/functions.js?ver=1790954155

js apdiving.com collected 2026-10-02 15:16:49 UTC 11,816 bytes, 335 lines download raw bytes

1/*
2 * jQuery doTimeout: Like setTimeout, but better! - v1.0 - 3/3/2010
3 * http://benalman.com/projects/jquery-dotimeout-plugin/
4 * 
5 * Copyright (c) 2010 "Cowboy" Ben Alman
6 * Dual licensed under the MIT and GPL licenses.
7 * http://benalman.com/about/license/
8 */
9(function($){var a={},c="doTimeout",d=Array.prototype.slice;$[c]=function(){return b.apply(window,[0].concat(d.call(arguments)))};$.fn[c]=function(){var f=d.call(arguments),e=b.apply(this,[c+f[0]].concat(f));return typeof f[0]==="number"||typeof f[1]==="number"?this:e};function b(l){var m=this,h,k={},g=l?$.fn:$,n=arguments,i=4,f=n[1],j=n[2],p=n[3];if(typeof f!=="string"){i--;f=l=0;j=n[1];p=n[2]}if(l){h=m.eq(0);h.data(l,k=h.data(l)||{})}else{if(f){k=a[f]||(a[f]={})}}k.id&&clearTimeout(k.id);delete k.id;function e(){if(l){h.removeData(l)}else{if(f){delete a[f]}}}function o(){k.id=setTimeout(function(){k.fn()},j)}if(p){k.fn=function(q){if(typeof p==="string"){p=g[p]}p.apply(m,d.call(n,i))===true&&!q?o():e()};o()}else{if(k.fn){j===undefined?e():k.fn(j===false);return true}else{e()}}}})(jQuery);
10
11/**
12 * Galleria v 1.3.3 2013-11-18
13 * http://galleria.io
14 *
15 * Licensed under the MIT license
16 * https://raw.github.com/aino/galleria/master/LICENSE
17 *
18 */
19
20jQuery(document).ready(function(){
21    
22    jQuery(".main .vgSlider .bx-viewport").addClass("fix");
23    jQuery( window ).resize(function() {
24        jQuery(".main .vgSlider .bx-viewport").removeClass("fix");
25    });
26        
27    // generate link point carosell
28    if (jQuery(".vgLinkPoint:not(.vgLinkPointHidden)").length > 0){
29
30        // generate html
31        $c = "<div class=\"vgCS shadow-below\"><div class=\"content\"><ul class=\"bxslider\">";
32        jQuery(".vgLinkPoint:not(.vgLinkPointHidden)").each(function(){
33            
34            $h = jQuery(this).children("a").attr("name");
35            $t = jQuery(this).children(".linkpointtext").val();
36            $i = jQuery(this).children(".linkpointimg").val();
37            
38            
39            if($i === "") {
40                $i = "https://www.apdiving.com/en/wp-content/themes/ap/img/ap-diving-carousel-place-holder.png";
41            }
42            $c += "<li style=\"background-image:url(" + $i + "); background-repeat:no-repeat; \">\n\<a class=\"vgLinkPointLink small-shadow-below\" href=\"#" + $h + "\"><h4>" + $t + "</h4><a/></li>";
43        }); 
44        $c+= "</ul></div></div>";
45
46        jQuery($c).insertBefore(".vgContent");
47
48    }
49    // make carosell slider and bind click event of carosel link point item
50    jQuery('.vgCS .bxslider').bxSlider({
51       useCSS: false, minSlides: 4, maxSlides: 4, slideWidth:232, slideMargin: 14, auto:false,pager:false,
52        onSliderLoad: function(currentIndex){
53            jQuery(".vgLinkPointLink").click(function(e){
54                e.preventDefault(); 
55                $a = jQuery(this).attr("href").replace("#",""); 
56                
57                var p = jQuery("a[name='"+ $a +"']").closest(".panel-grid div").offset().top; 
58                
59                console.log($a + " @ " + p);
60                
61                jQuery('html,body').animate({scrollTop: p - 200},'slow');
62            });
63        }
64    });
65    
66    
67    // more links
68    if (jQuery(".vg-more").length > 0){
69       // jQuery(".vg-more").parent().css("margin-top","-50px");
70        
71        jQuery(".vg-more").each(function(){
72            $panel = jQuery(this);            
73            $panel.hide();
74            $i = jQuery("<div class=\"vg-more-link-container shadow-below\"><div style=\"width:100%; margin:0px auto;\"><a class=\"vg-more-link\" href=\"#\">MORE</a><div class=\"clear\">&nbsp;</div></div></div>")
75            if($panel.hasClass("left")) {
76                $i.addClass("vg-left");
77            }
78            if($panel.hasClass("right")) {
79                $i.addClass("vg-right");
80            }
81            $i.insertAfter($panel);
82        });
83        
84        jQuery(".vg-more-link").click(function(e){
85            
86            e.preventDefault();
87
88            $b = jQuery(this); 
89            $p = $b.closest(".panel-grid").children(".vg-more");
90            
91            
92            
93            if($p.is(":visible")) {
94                jQuery('html,body').animate({scrollTop: $b.closest(".panel-grid").prev(".panel-grid").offset().top - 200},'slow',function(){
95                jQuery($p)
96                    .animate({opacity: 0}) 
97                    .slideUp(350)             
98                    $b.html("MORE"); $b.css({opacity:1});
99                });    
100                
101            } else {
102                
103                jQuery($p)
104                    .css('opacity',0)
105                    .slideDown('slow')
106                    .delay(100)
107                    .animate(
108                        {opacity: 1}
109                    );
110                
111                    jQuery('html,body').animate({scrollTop: $p.offset().top - 200},'slow'); 
112                
113                $b.html("CLOSE");$b.css({opacity:1});
114            }            
115            
116            });
117  
118    }
119    
120    
121    
122    
123    
124    // active hover effect
125    jQuery(".vgSummaryLink a, .bx-controls-direction a,.vgCS li, #nav li.last, .shop, .vgSubNav a").mouseenter(function() {jQuery(this).addClass("active",300);}).mouseleave(function(){jQuery(this).removeClass("active",300);});
126    //jQuery(".vgLink").mouseenter(function() {jQuery(this).addClass("hover",300);}).mouseleave(function(){jQuery(this).removeClass("hover",300);});
127    
128    
129    // hide and show slider arrows
130    jQuery(".vgSlider").mouseenter(function() {jQuery(".vgSlider .bx-controls-direction a").fadeIn(200);}).mouseleave(function(){jQuery(".vgSlider .bx-controls-direction a").fadeOut(200);});
131    
132    jQuery(".vgCS").mouseenter(function() {jQuery(".vgCS .bx-controls-direction").fadeIn(300);}).mouseleave(function(){jQuery(".vgCS .bx-controls-direction").fadeOut(300);});
133    
134    jQuery(".vgBestSellers").mouseenter(function() {
135        jQuery(".vgBestSellers .bx-controls-direction").fadeIn(300);
136    }).mouseleave(function(){
137        jQuery(".vgBestSellers .bx-controls-direction").fadeOut(300);
138    });
139    
140        // Scroll to top for Mobile.
141    jQuery(window).scroll(function () {
142        if (jQuery(document).scrollTop() > 200) {
143            jQuery("#vgScrollTop").fadeIn('150');
144        } else {
145            jQuery("#vgScrollTop").fadeOut('150');
146        }
147    });
148
149    // top arrow click scroll up
150    jQuery("#vgScrollTop").click(function (e) {
151        e.preventDefault();
152        jQuery('html,body').animate({
153            scrollTop: 0
154        }, '150');
155    });
156    
157    // copytight hide show
158    jQuery(".vg-image-widget,.vgSlider")
159        .mouseenter(function() {
160            jQuery(this).find("span.caption").fadeIn(300);
161       })
162        .mouseleave(function(){
163            jQuery(this).find("span.caption").fadeOut(300);
164    });
165        
166        
167    // sign up boxed
168    /*
169    
170    jQuery(".block-subscribe input#mobile,.block-subscribe input#newsletter").focus(function(){
171        if ($(this).val() === $(this)[0].title){$(this).val("");}
172    }).blur(function() {
173        if ($(this).val() === "") {$(this).val($(this)[0].title);}
174    });
175    
176    */
177        
178        
179        
180        
181        
182    window.scrollTo(0, 0);
183});
184
185jQuery(window).on('load',function() {
186    if(window.location.hash) {
187        if(window.location.hash !== "" && window.location.hash !== "#") {
188        $a = window.location.hash.replace("#!",""); 
189        var p = jQuery("a[name='"+ $a +"']").offset().top -200; 
190        jQuery('html,body').animate({scrollTop: p},'slow');
191        window.location.hash = "";
192        }
193    } 
194    
195});
196
197
198
199jQuery(window).on('hashchange', function() {
200    if(window.location.hash !== "" && window.location.hash !== "#") {
201        $a = window.location.hash.replace("#!",""); 
202        var p = jQuery("a[name='"+ $a +"']").offset().top -200; 
203        jQuery('html,body').animate({scrollTop: p},'slow');
204        window.location.hash = "";
205    } 
206});
207
208
209
210
211
212
213
214this.tooltip = function () {
215    jQuery(".so-widget-sow-image.so-widget-sow-image-base").hover(function () {
216                        
217        var img_title = jQuery(this).children('.so-widget-image').attr('title');
218        
219                if (!!img_title) {
220                    
221                    //jQuery(".so-widget-image").attr("title") = "";
222                    
223                    jQuery(".so-widget-image").after('<p id="tooltip">' + img_title + '</p>');
224                    
225                    block_width = jQuery(".so-widget-image").innerWidth();
226                    block_height = jQuery(".so-widget-image").innerHeight();
227                                
228                    jQuery("#tooltip")
229                        .delay(150)
230                        .css("bottom", (0) + "px")
231                        .css("width", (block_width))
232                        .css("max-height", (block_height))
233                        .fadeIn(250);
234                }
235            },
236
237        function () {
238            //jQuery(".so-widget-image").attr("title") = img_title;
239            jQuery("#tooltip").delay(150).slideUp(250, function () {
240                jQuery(this).remove();
241            });
242        });
243};
244
245jQuery(document).ready(function () {
246    tooltip();
247});
248
249jQuery(document).ready(function () {
250    // Tooltip only Text
251   jQuery('.extra-info').hover(function () {
252        // Hover over code
253        title = jQuery(this).attr('title');
254        jQuery(this).removeAttr('title');
255        jQuery('<p class="info-hover"></p>')
256            .text(title)
257            .appendTo('body')
258            .fadeIn('normal');
259    }, function () {
260        // Hover out code
261        jQuery(this).attr('title', title);
262        jQuery('.info-hover').remove();            
263        
264    }).mousemove(function (e) {
265        var mousex = e.pageX + 20; //Get X coordinates
266        var mousey = e.pageY + 10; //Get Y coordinates
267        jQuery('.info-hover')
268            .css({
269                top: mousey,
270                left: mousex
271            })
272    });
273    
274    // Hide dropdown menu content on doc ready
275    jQuery(".wp-page-sub-nav-content").hide();
276
277    jQuery(".wp-page-sub-nav").click(function() { 
278        // Toggle Slide and fade in dropdown menu content on click
279        jQuery(this).find(".wp-page-sub-nav-content").animate({
280            height: "toggle",
281            opacity: "toggle"
282            });
283
284    });
285    
286    // Hide menu on click away
287    jQuery(document).mouseup(function (e) {
288        
289        if (!jQuery(".wp-page-sub-nav").is(e.target) // if the target of the click isn't the container...
290            && jQuery(".wp-page-sub-nav").has(e.target).length === 0) // ... nor a descendant of the container
291        {
292            jQuery(".wp-page-sub-nav-content").slideUp();
293        }
294    });
295    
296            jQuery(".wpcf7-response-output").click(function(){
297                jQuery(this).slideUp();        
298            });
299    
300    
301});
302
303
304jQuery(document).ready(function () {
305    
306    if (jQuery('.menu-bcds-sub-menu-container').length) {
307        alert('Found with Length');
308
309    // Stick the #nav to the top of the window
310    var nav = jQuery('.menu-bcds-sub-menu-container');
311    var navHomeY = nav.offset().top;
312    var isFixed = false;
313    var $w = jQuery(window);
314    $w.scroll(function() {
315        var scrollTop = $w.scrollTop();
316        var shouldBeFixed = scrollTop > navHomeY;
317        if (shouldBeFixed && !isFixed) {
318            nav.css({
319                position: 'fixed',
320                top: '20px',
321                left: nav.offset().left,
322                width: nav.width()
323            });
324            isFixed = true;
325        }
326        else if (!shouldBeFixed && isFixed)
327        {
328            nav.css({
329                position: 'static'
330            });
331            isFixed = false;
332        }
333    });
334    }        
335});

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.