-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbehavior.js
More file actions
35 lines (32 loc) · 816 Bytes
/
behavior.js
File metadata and controls
35 lines (32 loc) · 816 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
This file is for JS that is used solely
for design and behavior of the UI.
*/
/* Some variables to write less code later in the file */
var s2 = $('section:nth-child(2)');
var w = $(window);
var s4 = $('section:nth-child(4)'); // The section with the button.
var s3 = $('section:nth-child(3)');
var s5 = $('section:nth-child(5)');
(function ($) {
$(document).ready(function() {
rSize();
/* The positioning of the button */
var rtimer;
w.resize(function() {
clearTimeout(rtimer);
rtimer = setTimeout(rSize, 100);
});
function rSize() {
if (w.width() >= '481') {
var vpos = s2.position();
vpos = vpos.top;
vpos = vpos + s2.height() + 40;
s4.css('top', vpos);
vpos = vpos + s4.height() + 40;
s3.css('top', vpos);
s5.css('top', vpos);
}
}
});
})(jQuery)