Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

g-scroll

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

g-scroll

GScroll is a lightweight javascript tool to trigger a function when you scroll to a DOM.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

GScroll

GScroll is a lightweight javascript tool to trigger a function when you scroll to a DOM.

Live demo

Getting started

Install with NPM:
$ npm install g-scroll --save
Or use CDN:
https://cdn.rawgit.com/GA-MO/g-scroll/3dede7c2/lib/g-scroll.js

You can download the source as well. :)

Properties:
selector: '.element',           // Class name for trigger
offset: 10,                     // Offset point for trigger
delay: 0.5,                     // Time delay before call action
action: function(selector) {

    // this function will trigger when DOM in viewpoit
    // (selector) is current DOM in viewpoit
    // can use (selector) make a great thing with your favorite lib.

}
Example:
// Set up properties
var dataScroll = [
    {
        selector: '.element1',
        offset: 10,
        delay: 0.5,
        action: function(selector) {
            TweenMax.from(selector, 0.3, { y:100, opacity: 0 });
        }
    },
    {
        selector: '.element2',
        offset: 10,
        delay: 0.5,
        action: function(selector) {
            alert('Trigger me');
            $(selector).addClass('animated');
        }
    }
];

// Use
GScroll(dataScroll);

Keywords

FAQs

Package last updated on 06 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc