Skip to content

Commit 654a44a

Browse files
committed
Removed the public init() method
1 parent 527fa35 commit 654a44a

File tree

8 files changed

+29
-44
lines changed

8 files changed

+29
-44
lines changed

.github/main.workflow

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
workflow "publish on release" {
2+
on = "push"
3+
resolves = ["publish"]
4+
}
5+
6+
action "publish" {
7+
uses = "actions/npm@master"
8+
args = "publish"
9+
secrets = ["NPM_AUTH_TOKEN"]
10+
}

README.md

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
# Smooth Scroll [![Build Status](https://travis-ci.org/cferdinandi/smooth-scroll.svg)](https://travis-ci.org/cferdinandi/smooth-scroll)
22
A lightweight script to animate scrolling to anchor links. Smooth Scroll works great with [Gumshoe](https://github.com/cferdinandi/gumshoe).
33

4-
[View the Demo](https://codepen.io/cferdinandi/pen/wQzrdM)
4+
**[View the Demo on CodePen →](https://codepen.io/cferdinandi/pen/wQzrdM)**
5+
6+
[Getting Started](#getting-started) | [Scroll Speed](#scroll-speed) | [Easing Options](#easing-options) | [API](#api) | [What's new?](#whats-new) | [Known Issues](#known-issues) | [Browser Compatibility](#browser-compatibility) | [License](#license)
7+
8+
*__Quick aside:__ you might not need this library. There's [a native CSS way to handle smooth scrolling](https://gomakethings.com/smooth-scrolling-links-with-only-css/) that might fit your needs.*
59

610

711
<hr>
@@ -296,14 +300,6 @@ scroll.cancelScroll();
296300

297301
***Note:*** *This does not handle focus management. The user will stop in place, and focus will remain on the anchor link that triggered the scroll.*
298302

299-
#### init()
300-
Initialize Smooth Scroll. This is called automatically when you instantiate your `new SmoothScroll` object, but can be used to reinitialize your instance.
301-
302-
```javascript
303-
var scroll = new SmoothScroll();
304-
scroll.init('.some-selector');
305-
```
306-
307303
#### destroy()
308304
Destroy the current initialization. This is called automatically in the `init` method to remove any existing initializations.
309305

@@ -333,28 +329,7 @@ If you have multiple fixed headers, pass in the last one in the markup.
333329

334330

335331

336-
## Working with the Source Files
337-
338-
If you would prefer, you can work with the development code in the `src` directory using the included [Gulp build system](http://gulpjs.com/). This compiles, lints, and minifies code.
339-
340-
### Dependencies
341-
Make sure these are installed first.
342-
343-
* [Node.js](http://nodejs.org)
344-
* [Gulp](http://gulpjs.com) `sudo npm install -g gulp`
345-
346-
### Quick Start
347-
348-
1. In bash/terminal/command line, `cd` into your project directory.
349-
2. Run `npm install` to install required files.
350-
3. When it's done installing, run one of the task runners to get going:
351-
* `gulp` manually compiles files.
352-
* `gulp watch` automatically compiles files when changes are made and applies changes using [LiveReload](http://livereload.com/).
353-
354-
355-
356-
357-
## Migrating to Smooth Scroll 15 from Older Versions
332+
## What's new?
358333

359334
Scroll duration now varies based on distance traveled. If you want to maintain the old scroll animation duration behavior, set the `speedAsDuration` option to `true`.
360335

dist/smooth-scroll.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* smooth-scroll v15.2.1
2+
* smooth-scroll v16.0.0
33
* Animate scrolling to anchor links
44
* (c) 2019 Chris Ferdinandi
55
* MIT License
@@ -589,7 +589,7 @@
589589
* Initialize Smooth Scroll
590590
* @param {Object} options User settings
591591
*/
592-
smoothScroll.init = function (options) {
592+
var init = function () {
593593

594594
// feature test
595595
if (!supports()) throw 'Smooth Scroll: This browser does not support the required JavaScript methods and browser APIs.';
@@ -616,7 +616,7 @@
616616
// Initialize plugin
617617
//
618618

619-
smoothScroll.init(options);
619+
init();
620620

621621

622622
//

dist/smooth-scroll.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/smooth-scroll.polyfills.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* smooth-scroll v15.2.1
2+
* smooth-scroll v16.0.0
33
* Animate scrolling to anchor links
44
* (c) 2019 Chris Ferdinandi
55
* MIT License
@@ -659,7 +659,7 @@ if (window.Element && !Element.prototype.closest) {
659659
* Initialize Smooth Scroll
660660
* @param {Object} options User settings
661661
*/
662-
smoothScroll.init = function (options) {
662+
var init = function () {
663663

664664
// feature test
665665
if (!supports()) throw 'Smooth Scroll: This browser does not support the required JavaScript methods and browser APIs.';
@@ -686,7 +686,7 @@ if (window.Element && !Element.prototype.closest) {
686686
// Initialize plugin
687687
//
688688

689-
smoothScroll.init(options);
689+
init();
690690

691691

692692
//

0 commit comments

Comments
 (0)