ScrollWatcher(targetopt)

Scroll event watcher for smooth animation.

Constructor

new ScrollWatcher(targetopt)

Parameters:
Name Type Default Description
targetopt Element window

Element to watch

Author:
Satoshi Soma (amekusa.com)
License:
Apache-2.0
Copyright 2020 Satoshi Soma

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Source:
src/scripts/ScrollWatcher.js, line 22

Methods

on(ev, fn)

Registers a callback.

Parameters:
Name Type Description
ev
  • string
  • string[]

Event name(s). Pass any to register to all the available events

fn function

Callback

Source:
src/scripts/ScrollWatcher.js, line 44
Example
let sw.on('scroll', ev => {
  console.log('Scroll Detected');
});

watch(ev)

Starts watching scroll related events.

Parameters:
Name Type Default Description
ev
  • string
  • string[]
any

Event name(s) to watch. any to watch all the available events

Source:
src/scripts/ScrollWatcher.js, line 55

Licensed under the Apache License 2.0

Documentation generated by JSDoc 4.0.2 using Docolatte theme