diff options
author | Sam Alexander <sxalexander@gmail.com> | 2011-10-10 17:00:08 -0700 |
---|---|---|
committer | Sam Alexander <sxalexander@gmail.com> | 2011-10-10 17:00:08 -0700 |
commit | b0537c1ad65cb6f270506c88baf800e1ff193e68 (patch) | |
tree | c239fd9e5baed604670d5e0c80a636a3941c92f6 | |
parent | 482d819f8fece21218a3c7b544c424aec2e5a162 (diff) | |
download | jquery-scrollspy-b0537c1ad65cb6f270506c88baf800e1ff193e68.zip jquery-scrollspy-b0537c1ad65cb6f270506c88baf800e1ff193e68.tar.gz jquery-scrollspy-b0537c1ad65cb6f270506c88baf800e1ff193e68.tar.bz2 |
removing extra boilerplate
-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); } |