Skip to content

Commit 5d7721a

Browse files
committed
opts.scrollTarget was clobbering the link's hash. Fixes kswedberg#5
1 parent e25ce35 commit 5d7721a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

jquery.smooth-scroll.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
(function($) {
1818

19-
var version = '1.3';
19+
var version = '1.3.1';
2020

2121
var locationPath = filterPath(location.pathname);
2222

@@ -58,7 +58,8 @@ $.fn.extend({
5858
return this.pushStack(scrl);
5959
},
6060

61-
smoothScroll: function(options) {
61+
smoothScroll: function(options) {
62+
options = options || {};
6263
var opts = $.extend({}, $.fn.smoothScroll.defaults, options);
6364
this.die('click.smoothscroll').live('click.smoothscroll', function(event) {
6465

@@ -87,8 +88,8 @@ $.fn.extend({
8788
}
8889
}
8990

90-
if (include) {
91-
opts.scrollTarget = opts.scrollTarget || thisHash;
91+
if ( include ) {
92+
opts.scrollTarget = options.scrollTarget || thisHash;
9293
opts.link = link;
9394
event.preventDefault();
9495
$.smoothScroll(opts);

0 commit comments

Comments
 (0)