0.8.11 • Published 2 years ago

@pluginjs/headroom v0.8.11

Weekly downloads
-
License
GPL-3.0
Repository
github
Last release
2 years ago

Headroom

npm package

A flexible modern headroom js plugin.

Samples

Introduction

Installation

Yarn

yarn add @pluginjs/headroom

NPM

npm i @pluginjs/headroom

Getting Started

CDN:

Development:

<script src="https://unpkg.com/@pluginjs/headroom/dist/headroom.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@pluginjs/headroom/dist/headroom.css">

Production:

<script src="https://unpkg.com/@pluginjs/headroom/dist/headroom.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@pluginjs/headroom/dist/headroom.min.css">

Initialize

HTML:

<div class="element"></div>

ECMAScript Module:

import Headroom from "@pluginjs/headroom"
import "@pluginjs/headroom/dist/headroom.css"

Headroom.of(document.querySelector('.element'), options)

CommonJS:

require("@pluginjs/headroom/dist/headroom.css")
const Headroom = require("@pluginjs/headroom")

Headroom.of(document.querySelector('.element'), options)

Browser:

<link rel="stylesheet" href="https://unpkg.com/@pluginjs/headroom/dist/headroom.css">
<script src="https://unpkg.com/@pluginjs/headroom/dist/headroom.js"></script>
<script>
  Pj.headroom('.element', options)
</script>

API

Options

Options are called on headroom instances through the headroom options itself. You can also save the instances to variable for further use.

NameDescriptionDefault
"tolerance"normalize Tolerance, Mainly used in pinned mode{"down":10,"up":20}
"offset"Anchor offset, Mainly used for pinned mode and stick mode0
"scroller"Scroll elementwindow
"mode"Different judgmentspinned
"offsetSide"If offset is an element selector, you can specify his sizetop

Events

Events are called on headroom instances through the headroom events itself. You can also save the instances to variable for further use.

NameDescription
"ready"Gets fired when plugin is ready
"destroy"Gets fired when plugin is destroy
"enable"Gets fired when plugin is enabled
"disable"Gets fired when plugin is disabled

Methods

Methods are called on headroom instances through the headroom method itself. You can also save the instances to variable for further use.

NameDescription
"destroy"Destroy plugin
"disable"Disable plugin
"enable"Enabled plugin if plugin is disabled

Classes

Name | Description | Default --|| "NAMESPACE" | Declare plugin namespace | pj-headroom "PINNED" | Announce plugin is pinned | {namespace}-pinned "UNPINNED" | Announce plugin is unpinned | {namespace}-unpinned "TOP" | Announce plugin is top | {namespace}-top "NOTTOP" | Announce plugin is notTop | {namespace}-notTop "STICK" | Announce plugin is stick | {namespace}-stick "UNSTICK" | Announce plugin is unstick | {namespace}-unstick

Browser support

Tested on all major browsers.

IE / EdgeFirefoxChromeSafariOpera
IE11, Edgelast 2 versionslast 2 versionslast 2 versionslast 2 versions

License

@pluginjs/headroom is Licensed under the GPL-v3 license.

If you want to use @pluginjs/headroom project to develop commercial sites, themes, projects, and applications, the Commercial license is the appropriate license. With this option, your source code is kept proprietary.

For purchase an Commercial License, contact us purchase@thecreation.co.

Copyright

Copyright (C) 2022 Creation Studio Limited.

0.8.11

2 years ago

0.8.10

2 years ago

0.8.9

3 years ago

0.8.8

3 years ago

0.8.7

3 years ago

0.8.6

3 years ago

0.8.5

4 years ago

0.8.4

4 years ago

0.8.3

4 years ago

0.8.2

4 years ago

0.7.20

4 years ago

0.7.19

4 years ago

0.7.18

5 years ago

0.7.17

5 years ago

0.7.16

5 years ago

0.7.15

5 years ago

0.7.14

5 years ago

0.7.13

5 years ago

0.7.12

5 years ago

0.7.11

5 years ago

0.7.10

5 years ago

0.7.9

5 years ago

0.7.8

5 years ago

0.7.7

5 years ago

0.7.6

5 years ago

0.7.5

5 years ago

0.7.4

5 years ago

0.7.3

6 years ago

0.7.2

6 years ago

0.7.1

6 years ago

0.7.0

6 years ago

0.6.6

6 years ago

0.6.5

6 years ago

0.6.4

6 years ago

0.6.3

6 years ago

0.6.2

6 years ago

0.6.1

6 years ago

0.2.18

6 years ago

0.2.17

6 years ago

0.2.16

6 years ago

0.2.15

6 years ago

0.2.14

6 years ago

0.2.13

6 years ago

0.2.12

6 years ago

0.2.10

6 years ago

0.2.9

6 years ago

0.2.8

6 years ago

0.2.7

6 years ago

0.2.6

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago