Description
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.
Installation
Manual Installation
- Upload the entire
/hash-link-scroll-offset
directory to the/wp-content/plugins/
directory. - Activate Hash Link Scroll Offset through the ‘Plugins’ menu in WordPress.
- Update the “Hash Link Scroll Offset” setting on the general settings page, http://YOURSITE.COM/wp-admin/options-general.php.
Reviews
Contributors & Developers
“Hash Link Scroll Offset” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “Hash Link Scroll Offset” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
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
, andisScrolling
;
0.1.5
'hash_link_scroll_offset.complete'
jQuery event fired when scrolling complete.
0.1.4
- Fix “Cannot use a scalar value as an array” debug warning. (Relevant Trac ticket)
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
- Add
no-scroll
class exception. Props @billerickson
0.1.0
- First release