PageSourceSearch

https://www.kvmgalore.com/shopping/js/slideshow.js

js kvmgalore.com collected 2026-10-01 13:53:37 UTC 3,369 bytes, 119 lines download raw bytes

1jQuery(document).ready(function(){
2	
3	/**
4	 * 	home.php
5	 */
6	
7	jQuery('div.hidden-content').hide();
8	
9	// constants
10	var slideshow_manual	 = false;
11	var slideshow_delay		 = 3000;
12	var initial_delay		 	 = 3000;
13	var slideshow_autoplay;
14	
15	// activate pause button
16	jQuery('a.slideshow-pause').click(function(){
17		slideshow_manual = true;		
18		// kill autoplay
19	  if (slideshow_autoplay) {
20			clearTimeout(slideshow_autoplay);
21		}
22	});
23	
24	// activate play button
25	jQuery('a.slideshow-play').click(function(){
26		// restart autoplay, advance frame
27		slideshow_manual = false;
28		next_frame();		
29	});
30	
31	// activate pager frame links
32	jQuery('a.slideshow-pager').click(function(){
33		// kill autoplay
34		jQuery('a.slideshow-pause').click();
35		load_frame(this);
36	});
37
38	// kill autoplay on mouseover/out
39	jQuery('div#slideshow-container').hover(function(){
40		// over, kill autoplay
41	  if (slideshow_autoplay) {
42			clearTimeout(slideshow_autoplay);
43		}
44	}, function(){
45		// start over autoplay over again -- only if not in manual mode
46		if (!slideshow_manual) {
47			if (slideshow_autoplay) {
48				clearTimeout(slideshow_autoplay);
49			}
50			slideshow_autoplay = setTimeout(next_frame, slideshow_delay);	
51		}
52	});
53	
54	// find the next frame in sequence (for autoplay)
55	function next_frame() {
56		// get <a> obj of currently active li
57		var n = jQuery('div#slideshow-container li.active').next();
58		if (jQuery(n).attr('class') == 'play') {
59			// play button is next - we're at the end. next sibling of pause button is always 1st
60			var a = jQuery('div#slideshow-container li.pause').next().children('a:first');			
61		} else {
62			// use next
63			var a = jQuery(n).children('a:first');
64		}
65		load_frame(a);
66	}
67	
68	// load a frame into the slideshow
69	function load_frame(a) {
70		// hide deal of day, if its there
71		if (jQuery('div.deal-day-box')) {
72			jQuery('div.deal-day-box').slideUp('normal', function(){
73				jQuery(this).remove();
74			});
75		}
76		// remove active class
77		jQuery(a).parent('li').siblings('li.active').each(function(){
78			jQuery(this).removeClass('active');
79		});
80		// add active class to this page
81		jQuery(a).parent('li').addClass('active');
82		// corresponding frame ID is packed into rel attr w/ comma-delim for deal of day
83		var meta = jQuery(a).attr('rel').split(',');
84		var html = jQuery('#' + meta[0]).html();
85		jQuery('div.slideshow-page-container').fadeTo('normal', .1, function(){
86			jQuery(this).html(html);
87			
88			// force lightbox to see the newly updated HTML,
89			// so the thumbnail viewer works
90			// if (myLightbox) myLightbox.updateImageList();
91			
92			jQuery(this).fadeTo('normal', 1, function(){
93				// show deal of day?
94				if (meta[1] == 'dod') {
95					var dod = '<div style="display:none;" class="deal-day-box">Deal of the Day</div>';
96					jQuery('div#slideshow-container div.content-box').prepend(dod);
97					jQuery('div.deal-day-box').slideDown('normal');
98				}
99			});
100		});
101		// continue autoplay?
102		if (!slideshow_manual) {
103			if (slideshow_autoplay) {
104				clearTimeout(slideshow_autoplay);
105			}
106			slideshow_autoplay = setTimeout(next_frame, slideshow_delay);		
107		}
108	}
109	
110	// init
111	if (HOMEPAGE_SLIDESHOW_INITIAL_DELAY) {
112		initial_delay = HOMEPAGE_SLIDESHOW_INITIAL_DELAY * 1000;
113	}
114	if (HOMEPAGE_SLIDESHOW_REGULAR_DELAY) {
115		slideshow_delay = HOMEPAGE_SLIDESHOW_REGULAR_DELAY * 1000;
116	}
117	slideshow_autoplay = setTimeout(next_frame, initial_delay);
118
119});

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.