forked from softlayer/softlayer-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtoggle.js
More file actions
23 lines (21 loc) · 762 Bytes
/
toggle.js
File metadata and controls
23 lines (21 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
# Toggle
# Enables sliding/collapsing behavior for navigation
#
# Copyright © SoftLayer, an IBM Company
# Code and documentation licensed under MIT
*/
body = document.body;
iconElement = document.getElementById("icon-element");
navElement = document.getElementById("nav-element");
subnavElement = document.getElementById("subnav-element");
toggleElement = document.getElementById("toggle-element");
toggleElement.onclick = function() {
classify.toggle(body, "push");
classify.toggle(navElement, "pull");
classify.toggle(iconElement, "hidden");
classify.toggle(toggleElement, "fixed");
if (typeof(subnavElement) !== undefined && subnavElement !== null) {
classify.toggle(subnavElement, "hidden");
}
};