mirror of
https://github.com/servo/servo.git
synced 2025-10-04 02:29:12 +01:00
27 lines
537 B
HTML
27 lines
537 B
HTML
<!doctype html>
|
|
<title>Navigating to a text fragment anchor</title>
|
|
<script>
|
|
function checkScroll() {
|
|
let bc = new BroadcastChannel('scroll-to-text-fragment');
|
|
bc.postMessage({ didScrollToTarget: window.scrollY > 0 });
|
|
bc.close();
|
|
window.close();
|
|
}
|
|
</script>
|
|
<style>
|
|
body {
|
|
height: 3200px;
|
|
}
|
|
p {
|
|
position: absolute;
|
|
top: 3000px;
|
|
}
|
|
#element {
|
|
position: absolute;
|
|
top: 2000px;
|
|
}
|
|
</style>
|
|
<body onload="checkScroll()">
|
|
<div id="element">Element</div>
|
|
<p id="text">This is a test page</p>
|
|
</body>
|