Tuesday, August 31, 2010

jQuery.LocalScroll 1.2 released

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.ScrollTo is now at 1.3.2, it has a new option called 'over', check its demo to see it in action.
jQuery.LocalScroll 1.2.x requires jQuery.ScrollTo 1.3.1 or higher.

Links

Downloads

I really advice using the minified versions. The code is optimized for those releases. Source versions should only be used to learn.


setting up equations for given situations

No comments:

Post a Comment