PageSourceSearch

https://www.infoespacial.com/style/slideshow/slideshow.js?20121124

js infoespacial.com collected 2026-10-01 11:55:50 UTC 3,659 bytes, 106 lines download raw bytes

1	//inicializacion
2	jQuery.fn.slideshow = function(speed, efecto) {
3		
4		speed = speed || 290000;
5		
6		slideShow(this, speed);
7		
8		return this;
9	};
10	
11
12function slideShow(speed, efecto, element) {
13	speed = speed || 9000;
14	element = element || document.body;
15
16
17	if (jQuery('ul.slideshow', element).size() > 0) {
18		//append a LI item to the UL list for displaying caption
19		//jQuery('ul.slideshow', element).append('<li id="slideshow-caption" class="caption"><div class="slideshow-caption-container"><h3></h3><p></p></div></li>');
20
21		//Set the opacity of all images to 0
22		jQuery('ul.slideshow li', element).css({opacity: 0.0});
23		
24		//Get the first image and display it (set it to full opacity)
25		var first = jQuery('ul.slideshow li:first', element);
26		first.css({opacity: 1.0}).addClass('show');
27		
28		//first = jQuery('ul.slideshow li.show', element);
29		
30		//Get the caption of the first image from REL attribute and display it
31		jQuery('#slideshow-caption h3', element).html(first.find('img').attr('title'));
32		jQuery('#slideshow-caption p', element).html(first.find('img').attr('alt'));
33			
34		//Display the caption
35		jQuery('#slideshow-caption', element).css({opacity: 0.7, bottom:0});
36		
37		//Call the gallery function to run the slideshow	
38	//	var timer = setInterval('gallery()',speed);
39		var timer = setInterval(function() { gallery(element, speed); },speed);
40		
41		//pause the slideshow on mouse over
42		jQuery('ul.slideshow', element).hover(
43			function () {
44				clearInterval(timer);
45			},
46			function () {
47	///			timer = setInterval('gallery()',speed);
48				timer = setInterval(function() { gallery(element, speed); }, speed);
49			}
50		);
51	}
52}
53
54function gallery(element, speed) {
55	element = element || document;
56	delay = speed; //6000;
57
58	//console.log('gallery');
59
60	jQuery('#slideshow-caption', element).css({opacity: 0.7, bottom:0});
61	//if no IMGs have the show class, grab the first image
62	var current = (jQuery('ul.slideshow li.show', element)?  jQuery('ul.slideshow li.show', element) : jQuery('#ul.slideshow li:first', element));
63	
64	//trying to avoid speed issue
65	if (current.queue('fx').length == 0) {
66	
67		//Get next image, if it reached the end of the slideshow, rotate it back to the first image
68		var next = ((current.next().length) ? ((current.next().attr('id') == 'slideshow-caption')? jQuery('ul.slideshow li:first', element) :current.next()) : jQuery('ul.slideshow li:first', element));
69			
70		//Get next image caption
71		var title = next.find('img').attr('title');
72		var desc = next.find('img').attr('alt');
73		var caption = jQuery('#slideshow-caption', element);
74		
75		
76		jQuery('#slideshow-caption h3', element).html(title); 
77		jQuery('#slideshow-caption p', element).html(desc); 
78		var effect = false;
79		if (effect) {
80			//Set the fade in effect for the next image, show class has higher z-index
81			next.css({opacity: 0.0}).addClass('show').animate({opacity: 1.0}, 100, function() {
82				// Animation complete.
83			});
84			next.css({opacity: 0.0}).addClass('show').animate({opacity: 1.0}, 100);
85			caption.css({opacity: 0.0}).animate({opacity: 1.0}, 100);
86			
87			//Hide the caption first, and then set and display the caption
88			//jQuery('#slideshow-caption', element).slideToggle(100, function () { 
89			//	jQuery('#slideshow-caption', element).slideToggle(delay); 
90			//});
91			
92			caption.animate({opacity: 1.0}, delay);
93			//Hide the current image
94			current.animate({opacity: 0.0}, delay).removeClass('show');
95		} else {
96			next.css({opacity: 1.0}).addClass('show');
97			current.css({opacity: 0.0}).removeClass('show');
98			
99				//	timer = setInterval(function() { current.css({opacity: 0.0}).removeClass('show');	 }, speed);
100		
101					
102		}
103
104	}
105
106}

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.