PageSourceSearch

https://benesovskymlyn.cz/wp-content/themes/benesovsky_mlyn/js/main.js

js benesovskymlyn.cz collected 2026-10-01 23:52:12 UTC 6,052 bytes, 219 lines download raw bytes

1jQuery(document).ready(function ($) {
2
3    // read more
4    $("#mor").click(function () {
5        $(".moreArt").hide();
6        $(".moreArticle").fadeIn('slow');
7    })
8
9
10    // search
11    $('#searchsubmit').attr('class', 'btn');
12
13
14    // subSlider
15    var nav = $('#articlesNavigation');
16    var spanNav = nav.find('span');
17    var defaultValue = $('#articlesBox').find('.articleBox').length;
18    var buttonsCount = -1;
19    var plus = 0;
20    var position = 0;
21    for (var i = 1; i <= defaultValue; i++) {
22        if (i % 3 == 0 && i != defaultValue) {
23            buttonsCount++;
24            spanNav.append('<a class="aNav" data-i="' + buttonsCount + '" data-top="' + plus + '" href="#"></a>');
25            plus -= 230;
26        }
27    }
28    if (defaultValue / buttonsCount > 0) {
29        buttonsCount++;
30        spanNav.append('<a class="aNav" data-i="' + buttonsCount + '" data-top="' + plus + '" href="#"></a>');
31    }
32
33    $($('.aNav')[0]).addClass('active');
34
35    $('.aNav').on('click', function (event) {
36        event.preventDefault();
37        $('.aNav').removeClass('active');
38        $(this).addClass('active');
39        position = $(this).attr('data-i');
40        valueTop = $(this).attr('data-top') + 'px';
41        $('#articlesBox').animate({'top': valueTop}, 500);
42    });
43    back = false;
44
45    setInterval(function () {
46        if (position == buttonsCount) {
47            back = true;
48        }
49
50        if (position == 0) {
51            back = false;
52        }
53
54        if (position < buttonsCount && back == false) {
55            position++;
56            $('#articlesBox').animate({'top': '-=230px'}, 500);
57        }
58
59        if (back == true) {
60            position--;
61            $('#articlesBox').animate({'top': '+=230px'}, 500);
62        }
63        $('.aNav').removeClass('active');
64        $($('.aNav')[position]).addClass('active');
65    }, 15000);
66
67    // end subSlider
68});
69
70
71jQuery.fn.sudoSlider = sudoSlider;
72var sliderSudo = null;
73
74var sudo = null;
75
76
77Sudo = function (sliderSudo) {
78
79    this.speed = 1000;
80    this.interval = null;
81    this.sliderSudo = sliderSudo;
82    this.slideMenu = $('#slidemenu');
83    this.ul = $('#slidemenu').find('ul');
84    this.height = this.ul.height();
85    this.current = 0;
86    this.count = this.ul.find('li').length;
87    this.direction = 'up';
88    this.isMoving = false;
89
90
91    this.init = function () {
92        //this.startInterval();
93        this.hover();
94    }
95
96    this.hover = function () {
97        var self = this;
98
99        $('#sUp').delay(500).click(function (event) {
100            event.preventDefault();
101            self.down();
102        });
103
104        $('#sDown').delay(500).click(function (event) {
105            event.preventDefault();
106            self.up();
107        });
108
109    }
110
111    this.startInterval = function () {
112        var self = this;
113        self.interval = self.setInterval();
114
115        $('#slide').mouseover(function () {
116            window.clearInterval(self.interval);
117        });
118
119        $('#slide').mouseleave(function () {
120            self.interval = self.setInterval();
121        });
122    }
123
124    this.setInterval = function () {
125        self = this;
126        return window.setInterval(function () {
127            if (self.current == 0) {
128                self.direction = 'up';
129            }
130
131            if (self.current == (self.count - 2)) {
132                self.direction = 'down';
133            }
134
135            if (self.direction == 'up') {
136                self.up();
137            } else {
138                self.down();
139            }
140        }, self.speed);
141    }
142
143    this.up = function () {
144        if (( -1 * this.ul.position().top) < (this.height - (80 * 3))) {
145            this.ul.animate({top: '-=80px'}, 500);
146        }
147        if ((this.count - 1) != this.current) {
148            this.sliderSudo.goToSlide(this.current + 2);
149            this.current++;
150        }
151        this.ul.find('li').removeClass('current');
152        $(this.ul.find('li')[this.current ]).addClass('current');
153    }
154
155    this.down = function () {
156        if (-1 * this.ul.position().top > 0) {
157            this.ul.animate({top: '+=80px'}, 500);
158        }
159        if ((this.count - 1) != this.current) {
160            this.sliderSudo.goToSlide(this.current + 2);
161            this.current--;
162        }
163        this.ul.find('li').removeClass('current');
164        $(this.ul.find('li')[this.current ]).addClass('current');
165    }
166
167}
168
169
170jQuery(document).ready(function ($) {
171    var sudoSlider = null;
172    var oldt = 0;
173    sudoSlider = $("#slider").sudoSlider({
174        auto: true,
175        speed: 800,
176        prevNext: true,
177        prevhtml: '<a href="" class="prevBtn"><span><i class="icon-chevron-up icon-white"></i></span></a>',
178        nexthtml: '<a href="" class="nextBtn"><span><i class="icon-chevron-down icon-white"></i></span></a>',
179        beforeAnimation: function (t) {
180            var magic = $('#slidemenu ul li').length;
181            var scroll = -t + 2;
182            //alert(scroll);
183            if (scroll == 1) scroll = 0;
184            if (scroll < -(magic - 4)) scroll = -(magic - 4);
185            var scroll = scroll * $('.custom').eq(0).outerHeight(true);
186            var diff = Math.sqrt(Math.abs(oldt - t));
187            var speed = parseInt(diff * 800);
188            $('#slidemenu ul').animate(
189                { top: scroll },
190                {
191                    queue: true,
192                    duration: speed
193                }
194            );
195            var substract = $('#slidemenu ul').offset();
196            var posi = $('#slidemenu ul li').eq(t - 1).offset();
197            var topvari = posi.top - substract.top;
198            $('#slidemenu ul li.currentone').animate({
199                marginTop: topvari
200            }, speed);
201            oldt = t;
202        },
203        customLink: '.custom'
204    });
205
206    $('#slidemenu').mouseenter(function () {
207        if ($.isFunction(sudoSlider.stopAuto))
208            sudoSlider.stopAuto();
209    });
210
211    $('#slidemenu, .container').mouseleave(function () {
212        if ($.isFunction(sudoSlider.startAuto))
213            sudoSlider.startAuto();
214    });
215
216
217});
218
219

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.