Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
44 lines (36 sloc) 1.29 KB
<!doctype html>
<html>
<head>
<title>Folding mockup</title>
<link rel="stylesheet" href="styles.css"/>
</head>
<body>
<div id="outer"></div>
<div id="folder"></div>
<div id="below"></div>
<div id="tri"></div>
<div id="ellipses"></div>
<div id="sep"></div>
<script>
var folded = false,
tri = document.getElementById("tri"),
ellipses = document.getElementById("ellipses"),
sep = document.getElementById("sep");
function handleAnimEnd() {
ellipses.style.display = sep.style.display = "block";
}
document.body.onclick = function (e) {
document.getElementById("folder").className = folded ? "doUnfold" : "doFold";
document.getElementById("below").className = folded ? "doBelowUnfold" : "doBelowFold";
tri.className = folded ? "expand" : "collapse";
if (folded) {
tri.removeEventListener("webkitAnimationEnd", handleAnimEnd);
ellipses.style.display = sep.style.display = "none";
} else {
tri.addEventListener("webkitAnimationEnd", handleAnimEnd);
}
folded = !folded;
};
</script>
</body>
</html>