Skip to content

luy19/jquery-pin

 
 

Repository files navigation

jQueryPin

jquery-pin

Ever wanted to pin something to the side of a text? Ever needed a subtle sticky element to quietly hang around as you scroll down?

jQueryPin is here to help! Pin any element to the top of a container. Easily disable it for smaller screen-sizes where there's no room for that kind of shenanigans.

Usage

Include jquery and jquery pin at the bottom of your html. Then pin any element you want like this:

$(".pinned").pin()

To make a pinned element stay within an outer container, use the containerSelector option:

$(".pinned").pin({containerSelector: ".container"})

Padding can also be added around the pinned element while scrolling:

$(".pinned").pin({padding: {top: 10, bottom: 10}})

That's it - go pin all the things!

Examples

Plenty of examples Here.

About

Pin any element within a container

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 39.8%
  • CSS 23.6%
  • TypeScript 22.4%
  • JavaScript 14.2%