New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

header-scroll-up

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

header-scroll-up

Hide the header while scrolling down, bring it back on scroll up!

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

header-scroll-up

Medium-like header scroll on page scroll, and pulls the header back on page up scroll!

Medium like header scroll

When you are building web pages with high text content, you do not want to distract the user with other elements on the screen. When the user is scrolling down your web page, you would want to hide the header elements assuming the reader is interested in reading further. On a scroll up event, you would show pull back the header assuming the reader wants to navigate elsewhere. This medium-like header show/hide is followed by various websites.

This usecase could be more applicable on Mobile-sites where the effective viewport is not very significant, hence, you'd want to show / hide the header based on the scroll-event.

Install

npm install header-scroll-up --save

Usage

let headerScroll = require ('header-scroll-up');

headerScroll.setScrollableHeader('.header', {topOffset: 100});

Parameters

Parameter 1 : Node / Query-selector
Parameter 2 : Options Object (optional)

Options

OptionDefaultDescription
defaultCsstrueWhether you will use your own css / default css to be used, value in boolean.
animationDelay0.2The animation delay to show / hide the header, value in number.
topOffset0Header will be hidden only when the page scroll crosses this mark, value in px.
classnamenullWhen defaultCss is false, passing the classname is mandatory, value in string.
Eg: headerScroll.setScrollableHeader('.header', {topOffset: 100, animationDelay: 0.5});

License

MIT © vijaysutrave

Keywords

header

FAQs

Package last updated on 06 Dec 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