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

hc-sticky

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hc-sticky

Cross-browser jQuery plugin that makes any element attached to the page and always visible while you scroll.

  • 1.2.43
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
659
decreased by-0.45%
Maintainers
1
Weekly downloads
 
Created
Source

HC-Sticky

v.1.2.43

Cross-browser jQuery plugin that makes any element attached to the page and always visible while you scroll.

##Call the plugin

<script src="/path/to/jquery.js"></script>
<script src="/path/to/jquery.hc-sticky.js"></script>
<script>
	jQuery(document).ready(function($){
		$('#element').hcSticky();
	});
</script>

Options and callbacks

Options can be updated at any time by calling the plugin again.

Example:

$('#element').hcSticky({
	top: 50
});
PropertyDefaultTypeDescription
top0intThe distance from the top of the Window at which to trigger HC-Sticky.
bottom0intThe distance from the bottom of the Window at which to glue HC-Sticky.
innerTop0intThe distance from the top inside of the sticky content at which to trigger HC-Sticky.
innerStickernulljQuery selectorElement at which to trigger HC-Sticky instead of top of sticky container. This has higher priority than innerTop option.
bottomEnd0intThe distance from the bottom of the referring element at which to stop HC-Sticky.
stickTonulljQuery selector / jQuery objectElement that represents the reference for height instead of height of the container. Usedocument for top menus.
responsivetruebooleanWhen set to true, HC-Sticky will recalculate its dimensions and position on resize.
offResolutionsnullint / arraySet resolutions at which HC-Sticky will turn itself off. If integer is negative, it will turn off below given resolution, if positive it will turn off above it. Example: [-780, 1600]
followScrolltruebooleanWhen set to false, sticky content will not move with the page if it is bigger that Window.
className"sticky"stringHTML class that will be applied to sticky element while it is floating.
wrapperClassName"wrapper-sticky"stringHTML class that is set to wrapper that HC-Sticky creates around your sticky element.
onStartfalsefunctionCallback function on plugin Start event (when the element starts floating).
onStopfalsefunctionCallback function on plugin Stop event (when the element stops floating and returns to its normal state).

Commands

Commands are used to control the plugin after initialization.

Example:

$('#element').hcSticky('stop');
CommandDescription
stopStops the sticky while preserving its current position.
offTurnes off the sticky completely.
onTurns the sticky back on after above two commands.
reinitRecalculates sticky size. Useful after altering DOM elements inside sticky.
destroyCompletely destroys sticky and reverts element to original state.

Keywords

FAQs

Package last updated on 02 Jun 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