Skip to content

Commit a50301c

Browse files
committed
force clipMargin
1 parent ecc29d5 commit a50301c

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

modules/overflow.html

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
pre {
1919
border: 2px dashed crimson;
20-
height: 100px;
20+
height: 150px;
2121
width: 20em;
2222
margin-bottom: 3em;
2323
overflow-clip-margin: 1em;
@@ -159,6 +159,7 @@
159159
pre.className = `${val.value}`;
160160
}
161161
scrollExample();
162+
clipMargin();
162163
});
163164

164165
wide.addEventListener("change", () => {
@@ -167,7 +168,7 @@
167168
});
168169

169170
ocm.addEventListener("change", () => {
170-
pre.style.overflowClipMargin = `${ocm.value}em`;
171+
clipMargin();
171172
});
172173

173174
scrollL.addEventListener("change", () => {
@@ -179,11 +180,15 @@
179180

180181
function scrollExample() {
181182
pre.scrollTo({
182-
top: scrollT.value * 26,
183+
top: scrollT.value,
183184
left: scrollL.value * 2,
184185
behavior: "smooth",
185186
});
186187
}
188+
189+
function clipMargin() {
190+
pre.style.overflowClipMargin = `${ocm.value}em`;
191+
}
187192
</script>
188193
</body>
189194
</html>

0 commit comments

Comments
 (0)