PageSourceSearch

https://kamna.astranet.cz/js/slider.js

js astranet.cz collected 2026-10-08 10:12:08 UTC 10,985 bytes, 333 lines download raw bytes

1$(window).load(function(){
2	new fwslider().init({
3		duration: "1000", /* Fade Speed (miliseconds) */
4		pause:    "12000"  /* Autoslide pause between slides (miliseconds)*/
5	});
6});
7
8
9function fwslider(){
10    var glob = {
11        cs : 0,
12        pause: 6000,
13        duration: 750
14    }
15    
16    this.init = function(params){
17        
18        if (params.duration) {
19            glob.duration = parseInt(params.duration,10);
20        }
21        
22        if (params.pause) {
23            glob.pause = parseInt(params.pause,10);
24        }
25        
26        /* Init */
27        content.init();
28        display.bindControls();
29        controls.bindControls();
30    }
31    
32    var display = {
33        /* Resize function */
34        resize: function(){
35            $("#nsslider").css({height: $("#nsslider .slide").height()});
36            controls.position();
37        },
38        
39        /* Bind resize listener */
40        bindControls: function(){
41            $(window).resize(function(){
42                display.resize()
43            });
44        }
45    }
46    
47    var controls = {
48        /* Adjust buttons position */
49        position: function(){
50            $("#nsslider .slidePrev, #nsslider .slideNext").css({
51                top: $("#nsslider").height() / 2 - $("#nsslider .slideNext").height() / 2
52            });
53            
54            $("#nsslider .slidePrev").css({left:0});
55            $("#nsslider .slideNext").css({right:0});
56        },
57        
58        /* Bind button controls */
59        bindControls : function(){
60            
61            /* Hover effect */
62            $("#nsslider .slidePrev, #nsslider .slideNext").on("mouseover", function(){
63                $(this).animate({
64                    opacity:1
65                },{
66                    queue:false, 
67                    duration:1000,
68                    easing:"easeOutCubic"
69                });
70            });
71            
72            /* Hover effect - mouseout */
73            $("#nsslider .slidePrev, #nsslider .slideNext").on("mouseout", function(){
74                $(this).animate({
75                    opacity:0.5
76                },{
77                    queue:false, 
78                    duration:1000,
79                    easing:"easeOutCubic"
80                });
81            });
82            
83            /* Next Button */
84            $("#nsslider .slideNext").on("click", function(){
85                if ($("#nsslider .slide").is(":animated")) return; 
86                
87                if ($("#nsslider .slide:eq("+(glob.cs+1)+")").length <= 0) {
88                    glob.cs = 0;
89                    
90                    $("#nsslider .timers .timer .progress").stop();
91                    
92                    $("#nsslider .timers .timer:last .progress").animate({
93                        width:"100%"
94                    },{
95                        queue:false,
96                        duration:glob.duration,
97                        easing:"easeOutCubic",
98                        complete: function(){
99                            $("#nsslider .timers .timer .progress").css({
100                                width:"0%"
101                            });
102                        }
103                    });
104                } else {
105                    glob.cs++;
106                    
107                    $("#nsslider .timers .timer .progress").stop();
108                    $("#nsslider .timers .timer:lt("+glob.cs+") .progress").animate({
109                        width:"100%"
110                    },{
111                        queue:false,
112                        duration:glob.duration,
113                        easing:"easeOutCubic"
114                    });
115                    
116                }
117                content.show();
118            });
119            
120            /* Previous Button */
121            $("#nsslider .slidePrev").on("click", function(){
122                if ($("#nsslider .slide").is(":animated")) return; 
123                
124                if (glob.cs <= 0) {
125                    glob.cs = $("#nsslider .slide").index();
126                    
127                    $("#nsslider .timers .timer .progress").stop();
128                    $("#nsslider .timers .timer .progress").css({
129                        width:"100%"
130                    });
131                     $("#nsslider .timers .timer:last .progress").animate({
132                        width:"0%"
133                    },{
134                        queue:false,
135                        duration:glob.duration,
136                        easing:"easeOutCubic"
137                    });
138                    
139                } else {
140                    glob.cs--;
141                    
142                    $("#nsslider .timers .timer .progress").stop();
143                    $("#nsslider .timers .timer:gt("+glob.cs+") .progress").css({
144                        width:"0%"
145                    });
146                    $("#nsslider .timers .timer:eq("+glob.cs+") .progress").animate({
147                        width:"0%"
148                    },{
149                        queue:false,
150                        duration:glob.duration,
151                        easing:"easeOutCubic"
152                    });
153                }
154                content.show();
155            });
156        }
157    }
158    
159    var content = {
160        init: function(){
161            /* First run content adjustment */
162            
163            for (var i = 0; i < $("#nsslider .slide").length; i++){
164                $('<div class="timer"><div class="progress"></div></div>').appendTo("#nsslider .timers");
165            }
166            
167            $("#nsslider .timers").css({
168                width: ($("#nsslider .timers .timer").length + 1) * 45
169            });
170            
171            $("#nsslider .slide:eq("+glob.cs+")").fadeIn({
172                duration:500, 
173                easing: "swing"
174            });
175            
176            $("#nsslider").animate({
177                height: $("#nsslider .slide:first img").height()
178            },{
179                queue:false,
180                duration:500, 
181                easing: "easeInOutExpo", 
182                complete: function(){
183                    $("#nsslider .slidePrev").animate({
184                        left:0
185                    },{
186                        queue:false,
187                        duration:0, 
188                        easing:"easeOutCubic"
189                    });
190                    
191                    $("#nsslider .slideNext").animate({
192                        right:0
193                    },{
194                        queue:false,
195                        duration:0, 
196                        easing:"easeOutCubic"
197                    });
198                    
199                    content.showText();
200                    controls.position();
201                    display.resize();
202                    auto.run();
203                    auto.focus();
204                }
205            });
206        },
207        
208        show: function(){
209            /* Show slide */
210            
211            content.hideText();
212            
213            $("#nsslider .slide:eq("+glob.cs+")").css({
214                opacity:0,
215                zIndex:2
216            }).show().animate({
217                opacity:1
218            },{
219                queue:false,
220                duration: glob.duration, 
221                easing: "swing", 
222                complete: function(){
223                    $("#nsslider .slide:lt("+glob.cs+"), #nsslider .slide:gt("+glob.cs+")").css({
224                        zIndex:0
225                    }).hide();
226                   
227                    $("#nsslider .slide:eq("+glob.cs+")").css({
228                        zIndex:1
229                    });
230                    content.showText();
231                    auto.run();
232                }
233            });
234        },
235        
236        showText: function(){
237            /* Show slide text */
238            
239             $("#nsslider .slide:eq("+glob.cs+") .title").animate({
240                opacity:1
241            },{
242                queue:false,
243                duration:300,
244                easing:"swing"
245            });
246            
247            setTimeout(function(){
248                $("#nsslider .slide:eq("+glob.cs+") .description").animate({
249                    opacity:1
250                },{
251                    queue:false,
252                    duration:300,
253                    easing:"swing"
254                });
255            },150)
256            
257            setTimeout(function(){
258                $("#nsslider .slide:eq("+glob.cs+") .readmore").animate({
259                    opacity:1
260                },{
261                    queue:false,
262                    duration:300,
263                    easing:"swing"
264                });
265            },300)
266            
267            
268        },
269        hideText: function(){
270            /* Hide slide text */
271            
272            $("#nsslider .slide .title").animate({
273                opacity:0
274            },{
275                queue:false,
276                duration:300,
277                easing:"swing"
278            });
279            
280            setTimeout(function(){
281                $("#nsslider .slide .description").animate({
282                    opacity:0
283                },{
284                    queue:false,
285                    duration:300,
286                    easing:"swing"
287                });
288            },150)
289            
290            setTimeout(function(){
291                $("#nsslider .slide .readmore").animate({
292                    opacity:0
293                },{
294                    queue:false,
295                    duration:300,
296                    easing:"swing"
297                });
298            },300)
299            
300            
301        }
302    }
303    
304    var auto = {
305        /* Run timer */
306        run: function(){
307            $("#nsslider .timer:eq("+glob.cs+") .progress").animate({
308                width:"100%" 
309            },{
310                queue:false,
311                duration: (glob.pause - (glob.pause/100)*((($("#nsslider .timer:eq("+glob.cs+") .progress").width() / $("#nsslider .timer:eq("+glob.cs+")").width()) * 100))), 
312                easing:"linear", 
313                complete: function(){
314                    $("#nsslider .slideNext").trigger("click");
315                }
316            });
317        },
318        
319        /* Stop on focus */
320        focus: function(){
321            $("#nsslider .slide_content").on("mouseover", function(){
322                if ($("#nsslider .slide").is(":animated")) return;
323                $("#nsslider .timer .progress").stop();
324            });
325            
326            $("#nsslider .slide_content").on("mouseleave", function(){
327                if ($("#nsslider .slide").is(":animated")) return;
328                auto.run();
329            });
330        }
331		
332    }
333}

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.