pedf
/
spolky
Archived
1
0
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

23 lines
537 B
Svelte

<style>
</style>
<script>
export let href;
function click() {
console.log(href);
window.scrollTo(0, 0);
var element = document.getElementById(href);
var panel = document.querySelector(".panel");
var elementPosition = element.getBoundingClientRect().top;
var offsetPosition = elementPosition - panel.scrollHeight;
window.scrollTo({
top: offsetPosition,
behavior: "smooth"
});
}
</script>
<span on:click|preventDefault={click}><slot></slot></span>