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

affixing-header

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

affixing-header

An affixing header that behaves normally as a user navigates down a page, but reveals itself naturally when a user scrolls or drags upwards. Inspired by iOS Safari, Medium, and others.

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Affixing Header  Build Status

Create an affixing header that behaves normally as a user navigates down a page, but reveals itself naturally when a user scrolls or drags upwards. Inspired by iOS Safari, Medium, and others. See an example implementation. Works on desktop and mobile browsers.

Sauce Test Status

Usage

The object exports an affixing-header module if being used with a CommonJS or AMD module loader, or else exposes a global object as window.affixingHeader.

affixingHeader( element )

element Element

The DOM element to which the affixing behaviour should be attached. Must be a single Element (e.g., the result of document.querySelector or document.getElementById), not a NodeList.

Dependencies

This package uses jank-free onscroll, a requestAnimationFrame-based, performant, mobile-friendly scroll event handler, to listen for page scrolls, but has no other dependencies.

Compatibility

The scroll handling uses requestAnimationFrame, which is only available in IE10+. For older browsers, your header simply won?t affix when you scroll up, but you shouldn?t see any other issues (yay progressive enhancement!). To add compatibility for older browsers, just include a requestAnimationFrame polyfill.

Keywords

FAQs

Package last updated on 07 Apr 2015

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