A new major update of jQuery.LocalScroll has seen the light.
Two minor releases were added after it and is now at 1.2.2. I'll detail them all together:
Optimizations
- Replaced a $('[name='+name+']') for a document.getElementsByName(name) to critically improve perfomance.
- Small improvements to make the code shorter.
Fixes
- The last argument received by onBefore when scrolling the window, is no more $(window) but the real element being scrolled.
Changes
- Renamed the option 'persistent' to 'lazy', the latter seemed more adequate. Using 'persistent' will still work (backwards compatibilty)
Features
- Added the option 'stop', if true (default), each event will stop any previous animations of the target.
- Added the option 'lock', if true, the plugin will ignore events if already animating.
- Added $.localScroll.hash( settings ); which will scroll to the given element if the URL contains a valid hash.
- Removed the option 'cancel' that wasn't working well, and added the option 'hash'. It does what 'cancel' was meant to do, but in a different way.
After a scroll, the hash( #some_id ) of the link is added to the URL.
Note:This setting is not compatible with options like offset and margin, as the browser will natively scroll in the end.
If you use the option 'target'(to scroll an overflowed element) and the window has overflow, setting the hash will scroll the window as well. So my advice is:
only use 'hash' when scrolling the window.
jQuery.LocalScroll 1.2.x requires jQuery.ScrollTo 1.3.1 or higher.
Links
- Main post
- Project Page
- Regular Demo
- AJAX Demo
- jQuery.ScrollTo
- jQuery.ScrollTo's demo (must see)
- Changelog
Downloads
- jQuery.LocalScroll 1.2.7 Zip(all files and docs)
- jQuery.LocalScroll 1.2.7 Source(to learn or test)
- jQuery.LocalScroll 1.2.7 Minified(recommended)
- jQuery.ScrollTo 1.4.2 Source(to learn or test)
- jQuery.ScrollTo 1.4.2 Minified(recommended)
setting up equations for given situations