-
Notifications
You must be signed in to change notification settings - Fork 3
/
init.js
35 lines (29 loc) · 1.03 KB
/
init.js
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
$(document).ready(function($) {
// set panel min-height to full browser height
$(window).bind("load resize", function(){
var h = $(window).height();
$("#wrapper, #grid, #navBg").css({ "min-height" : (h) });
$("#content").css({ "min-height" : (h-168) });
});
// toggle grid
$("#grid").hide();
$(document.documentElement).keyup(function (event) {
if (event.keyCode == 71) {
$("#grid").fadeToggle(100);
}
});
// if window is larger than #nav then #nav == fixed, if #nav is larger than window #nav == relative
$(window).bind("load resize", function(){
var w = $(window).height();
var h = $("#nav").outerHeight();
$("#nav").css("position",(w < h) ? "" : "fixed");
});
// open / close off-canvas navigation
$('.off-canvas-button').click(function() {
// transform button to close shape
$(this).toggleClass('open');
// slide in side navigation
$('#nav').toggleClass('open');
});
// done!
});