PageSourceSearch

https://www.franchelle.com/wp-content/themes/shopkeeper/js/public/wc-product-navigation.js?ver=10.9.9

js franchelle.com collected 2026-10-10 00:37:25 UTC 3,256 bytes, 105 lines download raw bytes

1jQuery( function($) {
2
3	'use strict';
4
5	// Products Dot Navigation [ Product Version 2 & 3 ]
6
7	var productImagesController = $('.product-images-controller');
8	var productImages 			= $('.product-images-style-2 .product_images .product-image:not(.mobile), .product-images-style-3 .product_images .product-image:not(.mobile)');
9	var navigationItems 		= $('.product-images-style-2 .product-images-controller li a span.dot, .product-images-style-3 .product-images-controller li a span.dot');
10	var productImagesContainer 	= $('.product-images-wrapper');
11	var headerHeight 			= $('.site-header-sticky').length ? $('.site-header-sticky').outerHeight() : 0;
12
13	// set position of the product images controller layout 2
14
15	if ( $('.product_layout_cascade').length > 0 ) {
16
17		var controllerLayout2 	= $('.product_layout_cascade .product-images-controller');
18		controllerLayout2.css('top', productImagesContainer.offset().top);
19	}
20
21
22	$(window).on( 'scroll', function() {
23
24		navigationItems.addClass('current');
25
26		productImages.each(function() {
27
28			var $this = $(this);
29
30			var activeImage = $(' a[href="#'+$this.attr('id')+'"]').data('number');
31
32
33			if ( $this.offset().top + $this.outerHeight()  <= productImagesController.offset().top - headerHeight )  {
34
35			 	navigationItems.removeClass('current');
36
37				navigationItems.eq(activeImage).addClass('current');
38
39			} else {
40				navigationItems.eq(activeImage).removeClass('current');
41			}
42
43		});
44
45		// set youtube vide icon current
46
47		var youtubeVideo = $('.product_layout_cascade .fluid-width-video-wrapper');
48
49		if ( youtubeVideo.length > 0 ) {
50
51			if ( youtubeVideo.offset().top  <= productImagesController.offset().top - headerHeight ) {
52				$('li.video-icon span.dot').addClass('current');
53			} else {
54				$('.product-images-controller .video-icon .dot').removeClass('current');
55			}
56
57			if ( youtubeVideo.offset().top + youtubeVideo.outerHeight()  <= productImagesController.offset().top ) {
58
59				$('.product-images-controller .video-icon .dot').removeClass('current');
60			}
61
62		}
63
64	});
65
66
67	// navigationItem smooth scroll
68	if ( $('.single-product').length > 0 ) {
69
70		$('a[href*="#controller-navigation-image"]:not([href="#"])').on( 'click', function() {
71
72			if ( location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname ) {
73				var target = $(this.hash);
74				target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
75
76				// if wordpress admin bar exists take care of that
77				var adminBarHeight = 0;
78				if ( $('body').hasClass('admin-bar') ) {
79					var adminBarHeight = 32;
80				}
81
82				var header_height = $('.site-header-sticky').length ? $('.site-header-sticky').outerHeight() : 0;
83
84				if (target.length) {
85					$('html, body').animate({
86					  scrollTop: target.offset().top - header_height - adminBarHeight
87					}, 500);
88				return false;
89				}
90			}
91
92		});
93
94	}
95
96	// Video Autoplay on click
97	if ( $('.product-image.video iframe')) {
98
99		$('.product_layout_cascade .product-images-controller .video-icon > a').on('click', function(e) {
100			$('.product-image.video iframe')[0].src += "&autoplay=1";
101	    	e.preventDefault();
102		});
103
104	}
105 });

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.