PageSourceSearch

https://www.downandconnor.org/wp-content/themes/downandconnor_new/js/carousel.js?ver=7.1.2

js downandconnor.org collected 2026-10-02 07:17:22 UTC 3,095 bytes, 109 lines download raw bytes

1var j = jQuery.noConflict();
2j(window).load(function(){
3	window.itemW = j('.ngg-gallery-thumbnail').outerWidth(true);
4	window.numElements = j('.ngg-gallery-thumbnail').size();
5	window.divWidth = j('#carousel').width();
6	if(window.divWidth>'448'){
7		window.last = window.numElements - 3;
8	} else if(window.divWidth=='448'){
9		window.last = window.numElements - 2;
10	} else if(window.divWidth<'218'){
11		window.last = window.numElements - 1;
12	}
13	window.sliderPos = 0;
14	window.count = 0;
15	
16	window.carWidth=(window.itemW * window.numElements);
17	
18	window.lastPos = window.last * window.itemW *-1;
19
20	j('#carousel_in').css('width', window.carWidth);
21	
22	j('.carousel_nav').click(function(){
23		if(j(this).attr('id')=="prev"){
24			j('#carousel_nav #next').fadeIn();
25			
26			if(window.count<1){
27				j('#carousel_in').stop().animate({left : window.lastPos}, 500);
28				window.count = window.last;
29				window.sliderPos = window.lastPos;
30			}
31			else{
32				window.sliderPos += window.itemW;
33				window.count--;
34				j('#carousel_in').stop().animate({
35					left: window.sliderPos
36				}, 500);
37			}
38			
39		} else{
40			j('#carousel_nav #prev').fadeIn();
41			
42			if(window.count>=window.last){
43				window.count = 0;
44				window.sliderPos = 0;
45				j('#carousel_in').animate({ left : 0 }, 500);
46			}
47			else{
48				window.sliderPos -= window.itemW;
49				window.count++;
50				j('#carousel_in').stop().animate({
51					left: window.sliderPos
52				}, 500);
53			}
54		}
55	});
56	
57	jQuery('#carousel a').click(function(event){
58		event.preventDefault();
59		window.imgText = jQuery(this).closest('.ngg-gallery-thumbnail').children('span').text();
60		alertBox(jQuery(this).attr('href'), window.imgText);
61		window.imgpos = jQuery(this).closest('.ngg-gallery-thumbnail-box').index();
62	});
63	jQuery('.alertbox_out .close').click(function(event){
64		jQuery('.alertbox_out').fadeOut();
65	
66	});
67	jQuery('.lnav').click(function(){
68		if(jQuery(this).attr('id')=='prev_l'){
69			if(window.imgpos == 1){
70				window.imgpos = window.numElements;
71			} else{
72				window.imgpos--;
73			}
74		} else if(jQuery(this).attr('id')=='next_l'){
75			if(window.imgpos == window.numElements){
76				window.imgpos = 1
77			} else{
78				window.imgpos++;
79			}
80		}
81		alertBox(jQuery('#ngg-image-'+window.imgpos+' a').attr('href'),jQuery('#ngg-image-'+window.imgpos+' span').text());
82	});
83	
84});
85j(window).resize(function(){
86	window.itemW = j('.ngg-gallery-thumbnail').outerWidth(true);
87	window.divWidth = j('#carousel').width();
88	if(window.divWidth>'448'){
89		window.last = window.numElements - 3;
90	}
91	else if(window.divWidth=='448'){
92		window.last = window.numElements - 2;
93	}
94	else if(window.divWidth<'448'){
95		window.last = window.numElements - 1;
96	}
97	window.lastPos = window.last * window.itemW *-1;
98	window.carWidth=window.itemW * window.numElements;
99	j('#carousel_in').css('width', window.carWidth);
100});
101
102
103function alertBox(img, imgText){
104	jQuery('.alertbox_in img.limage').attr('src', img);
105	jQuery('.alertbox_in .imgtext').html(imgText);
106	jQuery('.alertbox_out').fadeIn();
107	
108	
109}

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.