Skip to content

Commit aaa1307

Browse files
committed
Updated readme
1 parent 0fb3a96 commit aaa1307

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,8 @@ A benefit of this approach is that it preserves browser history and let's users
310310
Here's a relatively lightweight helper function that listens for click events and uses the `smoothScroll.animateScroll()` method to scroll to the anchor. If you use this, you **should not** need initialize Smooth Scroll with `smoothScroll.init()`.
311311

312312
```js
313+
var scroll = new SmoothScroll();
314+
313315
var smoothScrollWithoutHash = function (selector, settings) {
314316
/**
315317
* If smooth scroll element clicked, animate scroll
@@ -323,7 +325,7 @@ var smoothScrollWithoutHash = function (selector, settings) {
323325
if ( !anchor ) return;
324326

325327
event.preventDefault(); // Prevent default click event
326-
smoothScroll.animateScroll( anchor, toggle, settings || {} ); // Animate scroll
328+
scroll.animateScroll( anchor, toggle, settings || {} ); // Animate scroll
327329
};
328330

329331
window.addEventListener('click', clickHandler, false );

0 commit comments

Comments
 (0)