PageSourceSearch

https://braindamaged.news/wp-content/themes/NTTheme/js/Sticky.js

js braindamaged.news collected 2026-10-04 00:19:50 UTC 3,428 bytes, 102 lines download raw bytes

1//UPDATED ON 11/6/2017 @ 1:34PM
2
3//////////////////////////////////////////////////////////////////////////////////////////////
4
5$(document).ready(function() {
6
7});
8
9//////////////////////////////////////////////////////////////////////////////////////////////
10
11$(window).load(function() {
12
13//$("body").append('<div id="Stats" style="display: block; width: 120px; text-align: center; padding: 15px; position: fixed; right: 20px; top: 20px; background-color: #333333; color: #CCCCCC; font-size: 12px;"></div>');
14
15var vStickyTop1 = $('.Sticky1').offset().top;	
16var vStickyTop2 = $('.Sticky2').offset().top;	
17CheckSticky(vStickyTop1, vStickyTop2);
18
19//-----------------------------------------------
20
21$(window).on( 'scroll', function() {					   
22CheckSticky(vStickyTop1, vStickyTop2);
23});
24
25//-----------------------------------------------
26
27$(window).resize(function() {
28var vContainerHeight = $('.Container').height();
29CheckSticky(vStickyTop1, vStickyTop2);
30});
31
32//-----------------------------------------------
33
34});
35
36//////////////////////////////////////////////////////////////////////////////////////////////
37//////////////////////////////////////////////////////////////////////////////////////////////
38//////////////////////////////////////////////////////////////////////////////////////////////
39//////////////////////////////////////////////////////////////////////////////////////////////
40//////////////////////////////////////////////////////////////////////////////////////////////
41
42function CheckSticky(vStickyTop1, vStickyTop2) {
43
44var vTop = $(window).scrollTop();
45var vContainerHeight = $('.Container').height();
46var vWindowWidth = $(window).innerWidth();
47var vWindowHeight = $(window).innerHeight();
48var vStickyHeight1 = $('.Sticky1').height();
49var vStickyHeight2 = $('.Sticky2').height();
50
51if (vStickyHeight2 < vStickyHeight1) {
52MakeSticky('.Sticky2', vStickyTop2, vContainerHeight);
53};
54
55};
56
57//////////////////////////////////////////////////////////////////////////////////////////////
58
59function MakeSticky(vDiv, vStickyTop, vContainerHeight) {	
60
61var vPadding = 40;
62
63var vTop = $(window).scrollTop();
64var vWindowWidth = $(window).innerWidth();
65var vWindowHeight = $(window).innerHeight();
66var vStickyWidth = $(vDiv).width() + 'px';
67var vStickyHeight = $(vDiv).height();
68var V1 = vWindowHeight + vTop;
69var V2 = vStickyTop + vStickyHeight + vPadding;
70var V3 = vContainerHeight - vWindowHeight + (vPadding * 2);
71
72//var vStats = V3 + " = " + vTop;
73//$('#Stats').html(vStats);
74
75if (V1 > V2 && V2 > vWindowHeight  + vPadding) { // Stick to the bottom of the column
76
77if (V3 <= vTop) { //footer area is in view, make div position absolute
78$(vDiv).removeAttr("style");	
79$(vDiv).css('position','absolute');
80$(vDiv).css('bottom',vPadding + 'px');
81$(vDiv).css('width',vStickyWidth);
82$('#Stats').html('absolute');
83
84} else { // footer area is hidden and bottom of Sticky is visible
85$(vDiv).removeAttr("style");	
86$(vDiv).css('position','fixed');
87$(vDiv).css('bottom',(vPadding-10) + 'px');
88$(vDiv).css('width',vStickyWidth);
89$('#Stats').html('fixed');
90};
91
92} ;
93
94if (V1 < V2 || vWindowWidth < 768) { //remove if screen is wider than 768px
95$(vDiv).removeAttr("style");	
96$(vDiv).css('width','100%');
97$('#Stats').html('nothing');
98};
99
100};
101
102//////////////////////////////////////////////////////////////////////////////////////////////

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.