3 <body style="height: 10000px">
5 <button id="toggle">Toggle</button>
8 The black rectangle starts fixed, and due to a transform will be composited. Toggle to unfix it and scroll: the black rectangle should scroll with the page and not overlap the numbers.
11 <div id="rect" style="background-color: black; width: 200px; height: 200px; position: fixed; transform: translate3d(0,0,0)">
36 var rect = document.getElementById("rect");
37 var toggle = document.getElementById("toggle");
39 toggle.addEventListener("click", function (ev) {
40 if (rect.style.position === "fixed") {
41 rect.style.position = "";
43 rect.style.position = "fixed";