PageSourceSearch

https://bezdomnye-zhivotnye.ru/t/v97/images/main.js

js bezdomnye-zhivotnye.ru collected 2026-10-06 05:03:37 UTC 4,932 bytes, 167 lines download raw bytes

1$(function(){
2
3$('.slider').megaSlider({
4		animation : 'slideLeft'
5});
6
7/* Placeholder */
8
9    if($.browser.msie){
10        $('.search-block input').attr('value','поиск');
11        $('.search-block input').focus(function(){
12            if($(this).val() == 'поиск'){
13                $(this).val('');
14            }
15        });
16
17        $('.search-block input').blur(function(){
18            if($(this).val() == ''){
19                $(this).val('поиск');
20            }
21        });
22    }
23
24    $('.go-up').on('click', function(){
25
26        $('html, body').animate({scrollTop : 0},800);
27
28        return false;
29    });
30
31/* - Placeholder */
32
33/* + Simple slider for next prev button only */
34
35    var Slider = {
36        _options: {},
37        currentIndex: 0,
38        maxIndex: 0,
39        iid: null,
40        init: function() {
41            var options = $.extend({
42                wrapSelector: '.slider-block ul', /* what is move element?*/
43                sliderSelector: '.slider-block',       /* what is slide wrapper?*/
44                elementSelector: '.slider-block ul li',     /* what inside elements?*/
45                duration: 1000,
46                sleep: 3000,
47                nextSelector: '.next-slide', /*Controls btn next*/
48                prevSelector: '.prev-slide'   /*Controls btn prev*/
49            }, this._options), text, elements;
50
51            this._options = options;
52
53            elements = $(options.elementSelector);
54            this.elementWidth = elements.eq(0).outerWidth(true);
55            this.maxIndex = elements.length;
56            this.wrap = $(options.wrapSelector);
57
58
59            if (elements.get(0)) {
60                text = this.wrap.html();
61                this.wrap.html(text + text + text).css('margin-left', -this.maxIndex * this.elementWidth);
62
63                this.enableAuto();
64
65                $(options.sliderSelector).hover(function() {
66                    Slider.disableAuto();
67                }, function() {
68                    Slider.enableAuto();
69                });
70
71                $(options.nextSelector).click(function() {
72                    if (Slider.wrap.is(':animated')) {
73                        return false;
74                    }
75                    Slider.next();
76                });
77
78                $(options.prevSelector).click(function() {
79                    if (Slider.wrap.is(':animated')) {
80                        return false;
81                    }
82                    Slider.prev();
83                });
84            }
85        },
86        enableAuto: function() {
87            this.iid = window.setInterval(function() {
88                Slider.next();
89            }, this._options.sleep);
90        },
91        disableAuto: function() {
92            window.clearInterval(this.iid);
93        },
94
95        next: function() {
96            this.currentIndex = this.getNextIndex();
97            this.wrap.animate({
98                'margin-left': -this.elementWidth * this.currentIndex - this.maxIndex * this.elementWidth
99            }, this._options.duration, function() {
100                var slider = Slider;
101                if (slider.currentIndex > slider.maxIndex - 1) {
102                    slider.currentIndex = 0;
103                    slider.wrap.css('margin-left', -slider.maxIndex * slider.elementWidth);
104                }
105            });
106        },
107
108        prev: function() {
109            this.currentIndex = this.getPrevIndex();
110            this.wrap.animate({
111                'margin-left': -this.elementWidth * this.currentIndex - this.maxIndex * this.elementWidth
112            }, this._options.duration, function() {
113                var slider = Slider;
114                if (slider.currentIndex <= -slider.maxIndex) {
115                    slider.currentIndex = 0;
116                    slider.wrap.css('margin-left', -slider.maxIndex * slider.elementWidth);
117                }
118            });
119        },
120
121        getNextIndex: function() {
122            var i = this.currentIndex + 1;
123            if (i > this.maxIndex + 1) {
124                i = 0;
125            }
126            return i;
127        },
128        getPrevIndex: function() {
129            var i = this.currentIndex - 1;
130            if (i < -this.maxIndex) {
131                i = 0;
132            }
133            return i;
134        }
135    }
136
137    $(function() {
138        Slider.init();
139    });
140
141/* - Simple slider for next prev button only  */
142
143$('.bottom-line-two a').on('click', function(){
144    $(window).scrollTop(0);
145
146    return false;
147});
148
149var inp = $('.search-block .search-container > .field input');
150
151inp.focus(function(){
152  if (this.value=='поиск') this.value=''
153$(this).removeClass('place-color');
154  });
155inp.blur(function(){
156if (this.value=='') {
157this.value='поиск';
158  $(this).addClass('place-color');
159}
160  });
161$('.search-container').submit(function () {
162		if (this.search.value == 'поиск') this.search.value = '';
163return true;
164  });
165if (inp.val() == 'поиск') {inp.addClass('place-color')};
166
167});

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.