htmx/www/static/test/manual/scroll-test-targets.html
Alexander Petros d1288d202a
Remove old tests from the website (#1733)
The website used to host every past test suite, copied into the www
directory. We no longer need that on the website (and it makes the
codebase impossible to search) so I removed all the old tests and the
new tests are hosted simply at /test.

I also replaced the www.js script with a simpler www.sh one (since we no
longer need to do anything besides copying, really), which allowed me to
remove a node dependency that was only used in that script.
2023-09-19 11:07:24 -05:00

32 lines
1.1 KiB
HTML

<html lang="en">
<head>
<meta charset="utf-8" />
<title>Test Scroll Behavior</title>
<script src="../../src/htmx.js"></script>
</head>
<body style="padding:20px;font-family: sans-serif">
<script src="../../node_modules/sinon/pkg/sinon.js"></script>
<script src="../../src/htmx.js"></script>
<script src="../util/util.js"></script>
<script>
server = makeServer();
server.autoRespond = true;
server.respondWith("GET", "/demo", "Clicked...");
htmx.config.scrollBehavior = 'auto';
</script>
<h1>Scrolling Start/End Tests</h1>
<h3>End</h3>
<button hx-get="/demo" hx-swap="innerHTML show:#scroll-target:bottom">Scroll Bottom Of Div</button>
<button hx-get="/demo" hx-swap="innerHTML show:window:bottom">Scroll Bottom Of Window</button>
<hr/>
<h3>Start</h3>
<div id="scroll-target" style="height: 1500px; background-color: red; border: 1px solid black; scroll-margin:10px">
<h1>Scroll Target</h1>
</div>
<button hx-get="/demo" hx-swap="innerHTML show:#scroll-target:top">Scroll Top Of Div</button>
<button hx-get="/demo" hx-swap="innerHTML show:window:top">Scroll Top Of Window</button>
</body>
</html>