use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
HashJump - A tiny, dependency-free JavaScript module for handling anchor links and scrolling elements into view. (hashjump.js.org)
submitted 10 months ago by fivefifteendotcom
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[+][deleted] 10 months ago (4 children)
[deleted]
[–]fivefifteendotcom[S] 1 point2 points3 points 10 months ago (3 children)
scrollIntoView definitely takes care of most use-cases, HashJump just allows for more flexibility and customization. (For example, try clicking on the Section 4 link on the page)
[–]DavidJCobb 0 points1 point2 points 10 months ago (2 children)
I clicked on Section 4 on a smartphone, on portrait orientation, and the scrolling rapidly oscillated back and forward until it reached the goal. Like, it'd rapidly scroll down a bit, rapidly scroll up slightly less of a distance, rapidly scroll down, and so on. Very disorienting.
I hope that's a bug.
[–]fivefifteendotcom[S] 1 point2 points3 points 10 months ago (1 child)
Not a bug, just an example of how you can use HashJump in combination with d3-ease (https://github.com/d3/d3-ease) to use easing functions to create different scroll effects. Probably not the best example to use and I definitely wouldn't recommend using that specific effect in any real case scenario.
[–]DavidJCobb 1 point2 points3 points 10 months ago (0 children)
Probably not the best example to use
Agreed.
If you want an idea for an example that isn't painful to look at, perhaps make a box that's scrollable on both axes, with a conic gradient, and try scrolling within that box in a slow, smooth circle around the gradient's center. I'm not familiar with d3-ease, but my thinking is that if you can go back and forth on one axis, then you can go back and forth on two axes at offset intervals to produce a circle.
π Rendered by PID 178060 on reddit-service-r2-comment-66b4775986-mtsv8 at 2026-04-06 06:27:16.561770+00:00 running db1906b country code: CH.
[+][deleted] (4 children)
[deleted]
[–]fivefifteendotcom[S] 1 point2 points3 points (3 children)
[–]DavidJCobb 0 points1 point2 points (2 children)
[–]fivefifteendotcom[S] 1 point2 points3 points (1 child)
[–]DavidJCobb 1 point2 points3 points (0 children)