PageSourceSearch

http://rivneteploenergo.com/wp-content/themes/floatrx/js/main.js?refresh

js rivneteploenergo.com collected 2026-10-04 01:14:26 UTC 4,878 bytes, 147 lines download raw bytes

1// function SnowyHeader(){
2//   var vPos = $(window).scrollTop();
3//   var scrollTop = $(window).scrollTop();
4//   var target = $('body');
5//   var offset = target.offset().top;
6//   var height = target.outerHeight();
7//   var sWidth = $(window).width();
8//   if(sWidth<=1252) dY = 32; else dY = 11;
9//   var yBgPosition = Math.round((offset - scrollTop) * 0.03)-dY;
10//   if (yBgPosition>=-40) {
11//     target.css('background-position', 50 + yBgPosition+'%' + '0px');
12//     // $('.featured-slider').css('top',(yBgPosition*2)+'px');
13//   }
14// }
15
16// ------------ floatrx: detect mobile device ---------------
17// var isMobile = {
18//     Android: function() {
19//         return navigator.userAgent.match(/Android/i);
20//     },
21//     BlackBerry: function() {
22//         return navigator.userAgent.match(/BlackBerry/i);
23//     },
24//     iOS: function() {
25//         return navigator.userAgent.match(/iPhone|iPad|iPod/i);
26//     },
27//     Opera: function() {
28//         return navigator.userAgent.match(/Opera Mini/i);
29//     },
30//     Windows: function() {
31//         return navigator.userAgent.match(/IEMobile/i);
32//     },
33//     any: function() {
34//         return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows());
35//     }
36// };
37
38// ------------ cookies without jquery.cookie ---------------
39function setCookie(c_name, value, exdays) {
40  var exdate = new Date();
41  exdate.setDate(exdate.getDate() + exdays);
42  var c_value = escape(value) + ((exdays == null) ? "" : "; expires=" + exdate.toUTCString());
43  document.cookie = c_name + "=" + c_value;
44}
45function getCookie(cname) {
46  var name = cname + "=";
47  var ca = document.cookie.split(';');
48  for (var i = 0; i < ca.length; i++) {
49    var c = ca[i];
50    while (c.charAt(0) == ' ') c = c.substring(1);
51    if (c.indexOf(name) == 0) return c.substring(name.length, c.length);
52  }
53  return "";
54}
55function spoiler_state(id) {
56  var today = new Date();
57  var nextMonth = new Date(today.getYear(), today.getMonth(), today.getDate() + 15);
58  value = $('#' + id).css("display");
59  setCookie(id, value, 365);
60}
61
62function initSpoilers(){
63//floatrx: spoiler-global
64  $('.spoiler').each(function(index) {
65    var id = $(this).attr("data-toggle");
66    if (id == undefined) return;
67    var block = $('#' + id);
68    // var tags = $('#' + id+'-tags');
69    var self = $(this);
70    var vis = getCookie(id);
71    // alert(vis);
72    if (vis) {
73      block.css('display',vis);
74    }
75    $(this).click(function() {
76      console.log(id + ' >>>> ' + vis);
77      //toggle [show\hide] spoiler content, 
78      block.slideToggle('slow', function() {spoiler_state(id);}).delay(500);      //toggle spoiler-content
79    });
80  });
81}
82
83// Everything we need for scrolling up and down.
84$(window).scroll(function() {
85    if ($(window).scrollTop() > 300) {
86        $('#scroll-to-top').addClass('displayed');
87    } else {
88        $('#scroll-to-top').removeClass('displayed');
89    }
90});
91
92
93
94
95// $(document).scroll(function(){SnowyHeader();});
96$(document).ready(function() {
97  // responsive table scrolled with animation
98  $('a[data-table-control]').click(function(){
99      // tableScroll($(this),$(this).attr('data-to'));
100      var item = $("#"+ $(this).attr('data-table-control'));
101      var dx = -800;//scroll to left
102      if($(this).attr('data-to')==='left') dx = Math.abs(dx); //scroll to right
103      item.animate({scrollLeft: item.scrollLeft() - dx },600);
104      return;
105  });
106  
107  //floatrx: Spoilers with saving state
108    initSpoilers();
109    $('.back-btn-absolute').click(function(){
110      parent.history.back();
111      return;
112    });
113
114  //floatrx: JS-Clock 
115    // initDatetime(isMobile.any());
116
117  // $('body').css('background-position', 50 + '%' + '0px');
118  // floatrx: animated scroll to anchor
119	$('a[href*=#]:not(.carousel-control)').bind("click", function(e){
120			var anchor = $(this);
121			$('html, body').stop().animate({
122				scrollTop: $(anchor.attr('href')).offset().top
123			}, 600);
124			e.preventDefault();
125	}); // .animated scroll to anchor
126	// scroll-to-top
127
128  // floatrx: Custom poster for Videos
129  $('.video-home').each(function( index ){
130    var obj = $( this ).find('.video-home-overlay');
131    var overlay = $( this ).attr('data-overlay-image');
132    // checking before set overlay background image
133    if (!overlay) {
134      // disable overlay - show video original thumbnail
135      obj.hide();
136    } else {
137      // set overlay background image
138      obj.css('background-image','url('+overlay+')');
139    }
140    // anyway: Hide overlay image by click
141      obj.click(function(){
142        $( this ).fadeOut();//hide overlay 
143      });
144  });
145  // fix: firefox bug! 
146  // $('.msg-popup').addClass('bounceInUp').css('opacity','1');
147});// .document.ready

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.