PageSourceSearch

http://www.city-photos.org/public/js/user.js

js city-photos.org collected 2026-10-05 17:51:07 UTC 4,768 bytes, 159 lines download raw bytes

1//loading
2	$(window).load(function() {
3		$(".se-pre-con").fadeOut("slow");
4	});
5
6//slow scroll	  
7  $(document).ready(function(){
8    
9    $('.a').click(function(){
10        var idscroll = $(this).attr('href');
11        //$.scrollTo(idscroll, 1000);
12        $.scrollTo(idscroll, 1000, {'axis':'y'});
13        return false;
14    });
15    
16  });
17    jQuery(function(f){
18        var element = f('#back-top');
19        f(window).scroll(function(){
20        element['fade'+ (f(this).scrollTop() > 600 ? 'In': 'Out')](500);           
21    });
22});
23
24	
25
26//img src & realsrc
27function getCoords(elem) {
28    // (1)
29    var box = elem.getBoundingClientRect();
30    
31    var body = document.body;
32    var docEl = document.documentElement;
33    
34    // (2)
35    var scrollTop = window.pageYOffset || docEl.scrollTop || body.scrollTop;
36    var scrollLeft = window.pageXOffset || docEl.scrollLeft || body.scrollLeft;
37    
38    // (3)
39    var clientTop = docEl.clientTop || body.clientTop || 0;
40    var clientLeft = docEl.clientLeft || body.clientLeft || 0;
41    
42    // (4)
43    var top  = box.top +  scrollTop - clientTop;
44    var left = box.left + scrollLeft - clientLeft;
45    
46    // (5)
47    return { top: Math.round(top), left: Math.round(left) };
48}
49
50function isVisible(elem) {
51
52	var coords = getCoords(elem);
53	var windowTop = window.pageYOffset || document.documentElement.scrollTop;
54	var windowBottom = windowTop + document.documentElement.clientHeight;
55
56	coords.bottom = coords.top + elem.offsetHeight;
57
58	// âåðõíÿÿ ãðàíèöà elem â ïðåäåëàõ âèäèìîñòè ÈËÈ íèæíÿÿ ãðàíèöà âèäèìà
59	var topVisible = coords.top > windowTop && coords.top < windowBottom;
60	var bottomVisible = coords.bottom < windowBottom && coords.bottom > windowTop;
61
62	return topVisible || bottomVisible;
63}
64
65function showVisible() {
66
67	var imgs = document.getElementsByTagName('img');
68	for(var i=0; i<imgs.length; i++) {
69
70		var img = imgs[i];
71
72		var realsrc = img.getAttribute('realsrc');
73		if (!realsrc) continue;
74
75		if (isVisible(img)) {
76			img.src = realsrc;
77			img.setAttribute('realsrc', '');
78		}
79	}
80}
81window.onscroll = showVisible;
82showVisible();
83
84//div scroll
85/*(function(){
86//var a = document.querySelector('#aside1')
87if(document.documentElement.clientWidth>970) var a = document.querySelector('#adsmove-md');
88else if(document.documentElement.clientWidth>750) var a = document.querySelector('#adsmove-sm');
89
90var b = null, P = 0;  
91window.addEventListener('scroll', Ascroll, false);
92document.body.addEventListener('scroll', Ascroll, false);
93function Ascroll() {
94  if (b == null) {
95    var Sa = getComputedStyle(a, ''), s = '';
96    for (var i = 0; i < Sa.length; i++) {
97      if (Sa[i].indexOf('box-sizing') == 0 || Sa[i].indexOf('overflow') == 0 || Sa[i].indexOf('width') == 0 || Sa[i].indexOf('padding') == 0 || Sa[i].indexOf('border') == 0 || Sa[i].indexOf('outline') == 0 || Sa[i].indexOf('box-shadow') == 0 || Sa[i].indexOf('background') == 0) {
98        s += Sa[i] + ': ' +Sa.getPropertyValue(Sa[i]) + '; '
99      }
100    }
101    a.innerHTML = '<div style="'+s+'">'+a.innerHTML+'</div>';
102    b = a.children[0];
103    a.style.height = b.getBoundingClientRect().height + 'px';
104    a.style.padding = '0';
105    a.style.border = '0';
106  }
107  var Ra = a.getBoundingClientRect(),
108      R = Math.round(Ra.top + b.getBoundingClientRect().height - document.querySelector('#footer').getBoundingClientRect().top + 15); 
109  if ((Ra.top - P) <= 0) {
110    if ((Ra.top - P) <= R) {
111      b.className = 'stop';
112      b.style.top = - R +'px';
113    } else {
114      b.className = 'sticky';
115      b.style.top = P + 'px';
116    }
117  } else {
118    b.className = '';
119    b.style.top = '';
120  }
121}
122})()*/
123
124var okno = document.documentElement.clientHeight;
125var page = document.documentElement.scrollHeight;
126
127function offsetPosition(e) {
128  var offsetTop = 0;
129  do {offsetTop  += e.offsetTop;} while (e = e.offsetParent);
130  return offsetTop;
131}
132if(document.documentElement.clientWidth>970) var aside = document.querySelector('#adsmove-md');
133else if(document.documentElement.clientWidth>750) var aside = document.querySelector('#adsmove-sm');
134    OP = offsetPosition(aside);
135    
136window.onscroll = function() { 
137  showVisible();
138 if (page>okno+600){
139  
140  if (window.pageYOffset > document.documentElement.scrollHeight - okno) {
141    aside.className = 'stop';
142    aside.style.top = (document.documentElement.scrollHeight - okno- OP) + 'px';
143  } else {
144    aside.style.top = '0';
145     if (OP < window.pageYOffset) { 
146        if (aside.className != 'sticky') {aside.className = 'sticky'; aside.innerHTML = aside.innerHTML;  }
147      }
148     else aside.className = '';
149  }
150 } 
151}
152var elements = document.querySelectorAll("a.afadeout");
153for(var i = 0, len = elements.length; i < len; i++) {
154    elements[i].onclick = reload;
155}
156
157function reload(){
158        $("body").fadeOut(500);
159}

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.