Hash Link Scroll Offset
Contributors: webdevstudios, jtsternberg
Donate link: http://webdevstudios.com
Tags: Requires at least: 3.6.0 Tested up to: 4.7 Stable tag: 0.1.8 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html
Offset the scroll position of anchored links. Handy if you have a sticky header that covers linked material.
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.
no-scroll class on any hash links that are not meant to scroll to an area of the page (Navigation for sliders, etc).
- Upload the entire
/hash-link-scroll-offsetdirectory to the
- 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.
- Adjust JS to account for relative urls.
- Add checks for evt and event.preventDefault existing.
- Refactor JS to be more extensible, and adjust auto-scrolling (when hash exists in URL) to be more intelligent.
'hash_link_scroll_offset.scroll_to'jQuery event fired befor scrolling is initated. Also introduce useful properties,
'hash_link_scroll_offset.complete'jQuery event fired when scrolling complete.
- Fix "Cannot use a scalar value as an array" debug warning. (Relevant Trac ticket)
- Prevent browser windows from moving/blinking on initial click of anchor link. Props @ImBigWill.
- Automatically compensate for admin bar. Props @salcode.
no-scrollclass exception. Props @billerickson.
- First release