Hash Link Scroll Offset

ཞིབ་བརྗོད།

Often anchor links can be overachievers and can scroll a user past the section intended. This plugin attempts to change that by offering a setting that allows you to change the scroll offset when clicking anchors. It also adds a nice animated scrolling effect when clicking an anchor rather than the sudden jump that usually occurs. Even handles when visiting a hashed URL directly.

Use the no-scroll class on any hash links that are not meant to scroll to an area of the page (Navigation for sliders, etc).

Pluginize was launched in 2016 by WebDevStudios to promote, support, and house all of their WordPress products. Pluginize is not only creating new products for WordPress all the time, but also provides ongoing support and development for WordPress community favorites like CPTUI, CMB2, and more.

སྒྲིག་འཇུག

Manual Installation

  1. Upload the entire /hash-link-scroll-offset directory to the /wp-content/plugins/ directory.
  2. Activate Hash Link Scroll Offset through the ‘Plugins’ menu in WordPress.
  3. Update the “Hash Link Scroll Offset” setting on the general settings page, http://YOURSITE.COM/wp-admin/options-general.php.

གདེང་འཇོག

2025 ལོའི་ཟླ 3 ཚེས 19 ཉིན།
Does exactly what it is supposed to too. Not less, not more. Perfect.
2022 ལོའི་ཟླ 1 ཚེས 25 ཉིན།
That’s awesome, it’s still works!
2019 ལོའི་ཟླ 9 ཚེས 10 ཉིན།
This plugin is fantastic! So simple and effective (from this end, anyway). After hours of fighting Enfold’s CSS and JS in my child theme, this plugin just fixed my fixed-positioned header overlap issue with one simple setting. Thank you!
2018 ལོའི་ཟླ 7 ཚེས 10 ཉིན། 3 replies
Doesn’t play nice with my site’s back to top button. Click on an anchor link and the page scrolls to the anchor with the correct offset. BUT click back to top and the page only scrolls a little bit. Maybe by the amount of the offset, I’m not sure. But it looked to be about that distance.
2017 ལོའི་ཟླ 6 ཚེས 18 ཉིན།
I wasted hours trying a js or css solution to offeset anchors in Visual composer because the sticky menu covered t 100px. This plugin I just activated add 100px in the settings and BOOM !!! Ready Thank you guys!
གདེང་འཇོག 15 ཡོངས་སུ་ཀློག

བྱས་རྗེས་འཇོག་མཁན། & གསར་འབྱེད་པ།

“Hash Link Scroll Offset” is open source software. The following people have contributed to this plugin.

བྱས་རྗེས་འཇོག་མཁན།

དག་བཅོས་ཉིན་ཐོ།

0.4.2

  • Updated: Confirmed compatibility with WordPress 7.0.
  • Updated: Touched up admin link and setting styles.

0.4.1

  • Updated: Build process changes for compiled assets.
  • Updated: Confirmed compatibility with WordPress 6.9.

0.4.0

  • Fixed: issues with window scrollY offsets

0.3.2

  • Fixed: textdomain loading timing.
  • Updated: Confirmed compatibility with WordPress 6.8

0.3.1

  • Fixed: instant jumps instead of smooth scroll from previous jQuery conversion.

0.3.0

  • Updated: Removed jQuery dependency in our javascript
  • Updated: Escaping and sanitizing of output.

0.2.2

  • Confirmed compatibility with WordPress 6.4

0.2.1

  • Confirmed compatibility with WordPress 6.3

0.2.0

  • Misc changes
  • Tested up to WordPress 5.9 *

0.1.8

  • Adjust JS to account for relative urls.
  • Add checks for evt and event.preventDefault existing.

0.1.7

  • Refactor JS to be more extensible, and adjust auto-scrolling (when hash exists in URL) to be more intelligent.

0.1.6

  • 'hash_link_scroll_offset.scroll_to' jQuery event fired befor scrolling is initated. Also introduce useful properties, scrollTo, initialScroll, and isScrolling;

0.1.5

  • 'hash_link_scroll_offset.complete' jQuery event fired when scrolling complete.

0.1.4

0.1.3

  • Prevent browser windows from moving/blinking on initial click of anchor link. Props @ImBigWill.

0.1.2

  • Automatically compensate for admin bar. Props @salcode.

0.1.1

0.1.0

  • First release