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

airkit

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

airkit

Open-source JS modules

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
773
increased by12.68%
Maintainers
1
Weekly downloads
 
Created
Source

scrolltoggle

The scrolltoggle module listens for scroll events and updates elements that are tagged with the ak-scrolltoggle class with the state of the scroll, i.e. whether the user has scrolled up or down.

Sample usage

JS

var scrolltoggle = require('airkit/scrolltoggle');
scrolltoggle.init();

HTML

<div class="ak-scrolltoggle">
  Ths div turns blue when scrolling down, red when scrolling up.
</div>

SASS

.ak-scrolltoogle {
  background-color: white;
}
.ak-scrolltoggle--down {
  background-color: blue;
}
.ak-scrolltoggle--up {
  background-color: red;
}
Configuration options

Configuration options can be passed to the scrolltoggle.init() function to override default behavior.

Example

scrolltoggle.init({
  querySelector: 'header.mobile-slider'
});
OptionDefaultDescription
querySelector".ak-scrolltoggle"The CSS query selector for all elements that this module will toggle on scroll.
upClassName"ak-scrolltoggle--up"If provided, the CSS class name to apply when the user scrolls up.
downClassName"ak-scrolltoggle--down"If provided, the CSS class name to apply when the user scrolls down.
topClassNamenullIf provided, the CSS class name to apply when the user scrolls to the very top of the page.
offset5The offset, in px, to use before toggling the element.

FAQs

Package last updated on 22 Apr 2016

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