diff options
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | jquery-scrollspy.js | 17 |
2 files changed, 3 insertions, 16 deletions
@@ -2,7 +2,7 @@ An adaptation of the Mootools Scrollspy ( http://davidwalsh.name/mootools-scrollspy ) plugin for jQuery -(c) 2011 Samuel Alexander (samuel@madewithothers.com) +(c) 2011 Samuel Alexander (sxalexander@gmail.com) Released under The MIT License. diff --git a/jquery-scrollspy.js b/jquery-scrollspy.js index 46b5078..8f0a733 100644 --- a/jquery-scrollspy.js +++ b/jquery-scrollspy.js @@ -21,23 +21,8 @@ onTick: options.onTick ? options.onTick : [] } - // Here's a 'best' approach for overriding 'defaults' with specified options. - // Note how rather than a regular defaults object being passed as the second - // parameter, we instead refer to $.fn.pluginName.options explicitly, merging it - // with the options passed directly to the plugin. This allows us to override - // options both globally and on a per-call level. - var options = $.extend( {}, defaults, options ); - var init = function(){ - - } - - var processScroll = function(){ - - - } - return this.each(function (i) { var element = this; @@ -83,7 +68,9 @@ if(inside){ inside = false; leaves++; + /* trigger leave event */ $(element).trigger('scrollLeave', {position: position, leaves:leaves}) + if($.isFunction(o.onLeave)){ o.onLeave(element, position); } |