diff options
author | Sam Alexander <sxalexander@gmail.com> | 2014-11-10 14:48:38 -0800 |
---|---|---|
committer | Sam Alexander <sxalexander@gmail.com> | 2014-11-10 14:48:38 -0800 |
commit | 7837824c15dfb743cd54a04ba90cb510b3a32b2c (patch) | |
tree | dc7a8078b9bdce192e2632baa53d57b057fb151d | |
parent | b87810a645956a49b94b93662aa632f32e6b8979 (diff) | |
parent | cfdf6b4975e9e5d32cf759daa66a7d2007389781 (diff) | |
download | jquery-scrollspy-7837824c15dfb743cd54a04ba90cb510b3a32b2c.zip jquery-scrollspy-7837824c15dfb743cd54a04ba90cb510b3a32b2c.tar.gz jquery-scrollspy-7837824c15dfb743cd54a04ba90cb510b3a32b2c.tar.bz2 |
Merge pull request #10 from clslrns/master
Add 'namespace' option to bind scroll event with
-rw-r--r-- | jquery-scrollspy.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/jquery-scrollspy.js b/jquery-scrollspy.js index 5a4f189..7345496 100644 --- a/jquery-scrollspy.js +++ b/jquery-scrollspy.js @@ -12,6 +12,7 @@ min: 0, max: 0, mode: 'vertical', + namespace: 'scrollspy', buffer: 0, container: window, onEnter: options.onEnter ? options.onEnter : [], @@ -32,7 +33,7 @@ var inside = false; /* add listener to container */ - $container.bind('scroll', function(e){ + $container.bind('scroll.' + o.namespace, function(e){ var position = {top: $(this).scrollTop(), left: $(this).scrollLeft()}; var xy = (mode == 'vertical') ? position.top + buffer : position.left + buffer; var max = o.max; |