Skip to content

Scroll position detection and triggering module, for simple scroll-triggered CSS animations and transitions.

License

Notifications You must be signed in to change notification settings

rehabstudio/rehab-saucyjack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SaucyJack

What is it?

SaucyJack is a scroll position detection & triggering module. Example available to view here.

Usage

// require SausyJack module
var SaucyJack = require('../path/to/saucy-jack.js');

// Optional options
var options = {
    DEBUG: false,
    TRIGGER_LINE_POS: 0.85,
    ENTITY_SELECTOR: '.saucy-el',
    ACTIVE_CLASS: 'saucy-active',
    INVERT_BEHAVIOUR: false,
}

saucyJack = new SaucyJack.SaucyJack(options);

Methods

saucyJack.addElement(el)

Adds an element that triggers the event when this element enters the trigger zone.

Compiling

Install requirements using the following from the terminal in the project root directory:

npm install

SaucyJack is build using ES2015. To compile to ES5 compatible code use the following from the :

npm run compile

This will create both a /dist/build.js and /dist/build.min.js file, an un compressed file for development and a minified and uglified version for production.

Example

An example file is available in /example/index.html. To compile the latest version of the module code use:

npm run compile-example

To compile /src/saucy-jack.js for both the example and development/production use:

npm run compile-all

Testing

SaucyJack come with complete unit testing and code coverage. Tests are created in the /tests/spec.js file. To run the test use:

npm test

This will create a basic report in the terminal showing if any tests have failed and the total code coverage. To view the full coverage report open /tests/test-results/html/index.html

About

Scroll position detection and triggering module, for simple scroll-triggered CSS animations and transitions.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published