Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const behavior = "smooth";
- scrapbox.PageMenu.addItem({
- title: "Scroll to Top",
- onClick: () => window.scrollTo({top: 0, behavior})
- });
- scrapbox.PageMenu.addItem({
- title: "Scroll to Bottom",
- onClick: () => {
- const editor = $("#editor");
- const top = editor.offset().top + editor.outerHeight(true);
- window.scrollTo({top, behavior});
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement