Skip to content

Commit

Permalink
Fix a bug with body margin-bottom.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Jan 20, 2012
1 parent 4dbb345 commit 6b36aa6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion stack.js
Expand Up @@ -18,8 +18,11 @@ resize();
section.style("z-index", function(d, i) { return n - i; });

function resize() {
var offset = (window.innerHeight - size) / 2;

d3.select("body")
.style("margin-top", (window.innerHeight - size) / 2 + "px")
.style("margin-top", offset + "px")
.style("margin-bottom", offset + "px")
.style("height", (n - .5) * size + n * padding + "px");
}

Expand Down

0 comments on commit 6b36aa6

Please sign in to comment.