PageSourceSearch

https://muslimpolitic.ru/wp-content/themes/muslim2/js/loopedslider.js?ver=0.5.6

js muslimpolitic.ru collected 2026-10-02 12:17:23 UTC 9,191 bytes, 269 lines download raw bytes

1(function () { var jQuery = this.template_ugly_jquery; var $ = this.template_ugly_jquery;
2
3
4
5/*
6 * 	loopedSlider 0.5.6 - jQuery plugin
7 *	written by Nathan Searles	
8 *	http://nathansearles.com/loopedslider/
9 *
10 *	Copyright (c) 2009 Nathan Searles (http://nathansearles.com/)
11 *	Dual licensed under the MIT (MIT-LICENSE.txt)
12 *	and GPL (GPL-LICENSE.txt) licenses.
13 *
14 *	Built for jQuery library
15 *	http://jquery.com
16 *	Compatible with jQuery 1.3.2+
17 *
18 */
19
20/*
21 *	markup example for $("#loopedSlider").loopedSlider();
22 *
23 *	<div id="loopedSlider">	
24 *		<div class="container">
25 *			<div class="slides">
26 *				<div><img src="01.jpg" alt="" /></div>
27 *				<div><img src="02.jpg" alt="" /></div>
28 *				<div><img src="03.jpg" alt="" /></div>
29 *				<div><img src="04.jpg" alt="" /></div>
30 *			</div>
31 *		</div>
32 *		<a href="#" class="previous">previous</a>
33 *		<a href="#" class="next">next</a>	
34 *	</div>
35 *
36*/
37
38if(typeof jQuery != 'undefined') {
39	jQuery(function($) {
40		$.fn.extend({
41			loopedSlider: function(options) {
42				var settings = $.extend({}, $.fn.loopedSlider.defaults, options);
43			
44				return this.each(
45					function() {
46					if($.fn.jquery < '1.3.2') {return;}
47					var $t = $(this);
48					var o = $.metadata ? $.extend({}, settings, $t.metadata()) : settings;
49					
50					var distance = 0;
51					var times = 1;
52					var slides = $(o.slides,$t).children().size();
53					var width = $(o.slides,$t).children().outerWidth();
54					var position = 0;
55					var active = false;
56					var number = 0;
57					var interval = 0;
58					var restart = 0;
59					var pagination = $("."+o.pagination+" li a",$t);
60
61					if(o.addPagination && !$(pagination).length){
62						var buttons = slides;
63						$($t).append("<ul class="+o.pagination+">");
64						$(o.slides,$t).children().each(function(){
65							if (number<buttons) {
66								$("."+o.pagination,$t).append("<li><a rel="+(number+1)+" href=\"#\" >"+(number+1)+"</a></li>");
67								number = number+1;
68							} else {
69								number = 0;
70								return false;
71							}
72							$("."+o.pagination+" li a:eq(0)",$t).parent().addClass("active");
73						});
74						pagination = $("."+o.pagination+" li a",$t);
75					} else {
76						$(pagination,$t).each(function(){
77							number=number+1;
78							$(this).attr("rel",number);
79							$(pagination.eq(0),$t).parent().addClass("active");
80						});
81					}
82
83					if (slides===1) {
84						$(o.slides,$t).children().css({position:"absolute",left:position,display:"block"});
85						return;
86					}
87
88					$(o.slides,$t).css({width:(slides*width)});
89
90					$(o.slides,$t).children().each(function(){
91						$(this).css({position:"absolute",left:position,display:"block"});
92						position=position+width;
93					});
94
95					$(o.slides,$t).children(":eq("+(slides-1)+")").css({position:"absolute",left:-width});
96
97					if (slides>3) {
98						$(o.slides,$t).children(":eq("+(slides-1)+")").css({position:"absolute",left:-width});
99					}
100
101					if(o.autoHeight){autoHeight(times);}
102
103					$(".next",$t).click(function(){
104						if(active===false) {
105							animate("next",true);
106							if(o.autoStart){
107								if (o.restart) {autoStart();}
108								else {clearInterval(sliderIntervalID);}
109							}
110						} return false;
111					});
112
113					$(".previous",$t).click(function(){
114						if(active===false) {	
115							animate("prev",true);
116							if(o.autoStart){
117								if (o.restart) {autoStart();}
118								else {clearInterval(sliderIntervalID);}
119							}
120						} return false;
121					});
122
123					if (o.containerClick) {
124						$(o.container,$t).click(function(){
125							if(active===false) {
126								animate("next",true);
127								if(o.autoStart){
128									if (o.restart) {autoStart();}
129									else {clearInterval(sliderIntervalID);}
130								}
131							} return false;
132						});
133					}
134
135					$(pagination,$t).click(function(){
136						if ($(this).parent().hasClass("active")) {return false;}
137						else {
138							times = $(this).attr("rel");
139							$(pagination,$t).parent().siblings().removeClass("active");
140							$(this).parent().addClass("active");
141							animate("fade",times);
142							if(o.autoStart){
143								if (o.restart) {autoStart();}
144								else {clearInterval(sliderIntervalID);}
145							}
146						} return false;
147					});
148
149					if (o.autoStart) {
150						sliderIntervalID = setInterval(function(){
151							if(active===false) {animate("next",true);}
152						},o.autoStart);
153						function autoStart() {
154							if (o.restart) {
155							clearInterval(sliderIntervalID,interval);
156							clearTimeout(restart);
157								restart = setTimeout(function() {
158									interval = setInterval(	function(){
159										animate("next",true);
160									},o.autoStart);
161								},o.restart);
162							} else {
163								sliderIntervalID = setInterval(function(){
164									if(active===false) {animate("next",true);}
165								},o.autoStart);
166							}
167						};
168					}
169
170					function current(times) {
171						if(times===slides+1){times = 1;}
172						if(times===0){times = slides;}
173						$(pagination,$t).parent().siblings().removeClass("active");
174						$(pagination+"[rel='" + (times) + "']",$t).parent().addClass("active");
175					};
176
177					function autoHeight(times) {
178						if(times===slides+1){times=1;}
179						if(times===0){times=slides;}	
180						var getHeight = $(o.slides,$t).children(":eq("+(times-1)+")",$t).outerHeight();
181						$(o.container,$t).animate({height: getHeight},o.autoHeight);					
182					};		
183
184					function animate(dir,clicked){	
185						active = true;	
186						switch(dir){
187							case "next":
188								times = times+1;
189								distance = (-(times*width-width));
190								current(times);
191								if(o.autoHeight){autoHeight(times);}
192								if(slides<3){
193									if (times===3){$(o.slides,$t).children(":eq(0)").css({left:(slides*width)});}
194									if (times===2){$(o.slides,$t).children(":eq("+(slides-1)+")").css({position:"absolute",left:width});}
195								}
196								$(o.slides,$t).animate({left: distance}, o.slidespeed,function(){
197									if (times===slides+1) {
198										times = 1;
199										$(o.slides,$t).css({left:0},function(){$(o.slides,$t).animate({left:distance})});							
200										$(o.slides,$t).children(":eq(0)").css({left:0});
201										$(o.slides,$t).children(":eq("+(slides-1)+")").css({ position:"absolute",left:-width});				
202									}
203									if (times===slides) $(o.slides,$t).children(":eq(0)").css({left:(slides*width)});
204									if (times===slides-1) $(o.slides,$t).children(":eq("+(slides-1)+")").css({left:(slides*width-width)});
205									active = false;
206								});					
207								break; 
208							case "prev":
209								times = times-1;
210								distance = (-(times*width-width));
211								current(times);
212								if(o.autoHeight){autoHeight(times);}
213								if (slides<3){
214									if(times===0){$(o.slides,$t).children(":eq("+(slides-1)+")").css({position:"absolute",left:(-width)});}
215									if(times===1){$(o.slides,$t).children(":eq(0)").css({position:"absolute",left:0});}
216								}
217								$(o.slides,$t).animate({left: distance}, o.slidespeed,function(){
218									if (times===0) {
219										times = slides;
220										$(o.slides,$t).children(":eq("+(slides-1)+")").css({position:"absolute",left:(slides*width-width)});
221										$(o.slides,$t).css({left: -(slides*width-width)});
222										$(o.slides,$t).children(":eq(0)").css({left:(slides*width)});
223									}
224									if (times===2 ) $(o.slides,$t).children(":eq(0)").css({position:"absolute",left:0});
225									if (times===1) $(o.slides,$t).children(":eq("+ (slides-1) +")").css({position:"absolute",left:-width});
226									active = false;
227								});
228								break;
229							case "fade":
230								times = [times]*1;
231								distance = (-(times*width-width));
232								current(times);
233								if(o.autoHeight){autoHeight(times);}
234								$(o.slides,$t).children().fadeOut(o.fadespeed, function(){
235									$(o.slides,$t).css({left: distance});
236									$(o.slides,$t).children(":eq("+(slides-1)+")").css({left:slides*width-width});
237									$(o.slides,$t).children(":eq(0)").css({left:0});
238									if(times===slides){$(o.slides,$t).children(":eq(0)").css({left:(slides*width)});}
239									if(times===1){$(o.slides,$t).children(":eq("+(slides-1)+")").css({ position:"absolute",left:-width});}
240									$(o.slides,$t).children().fadeIn(o.fadespeed);
241									active = false;
242								});
243								break; 
244							default:
245								break;
246							}					
247						};
248					}
249				);
250			}
251		});
252		$.fn.loopedSlider.defaults = {
253			container: ".container", //Class/id of main container. You can use "#container" for an id.
254			slides: ".slides", //Class/id of slide container. You can use "#slides" for an id.
255			pagination: "pagination", //Class name of parent ul for numbered links. Don't add a "." here.
256			containerClick: false, //Click slider to goto next slide? true/false
257			autoStart: 5000, //Set to positive number for true. This number will be the time between transitions.
258			restart: 0, //Set to positive number for true. Sets time until autoStart is restarted.
259			slidespeed: 400, //Speed of slide animation, 1000 = 1second.
260			fadespeed: 200, //Speed of fade animation, 1000 = 1second.
261			autoHeight: 0, //Set to positive number for true. This number will be the speed of the animation.
262			addPagination: false //Add pagination links based on content? true/false
263		};
264	});
265}
266
267
268
269}.bind(this))()

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.