抹桥的博客
Language
Home
Archive
About
GitHub
Language
主题色
250
120 words
1 minutes
Fixed element

I’ve developed a js plugin that allows an element to be fixed at the top of the browser when scrolling down the page and reaching it, and return to its original position when scrolling up. For more details, click here: eleFixed This plugin provides both a native js version and a jQuery version:

Usage:

  • Native JS Version: First, include the elefixed.js file in your HTML, then call it like this: elefixed("ele");. The "ele" can be replaced with the ID of the element you want to target.
  • jQuery Version: Simply call the method directly on the element, like this: $("ele").elefixed(). Here, "ele" no longer needs to be an ID like in the native version; any valid jQuery selector for the element will work.

Download Link:

Fixed element
https://blog.kisnows.com/en-US/2015/01/22/jquery-plugin-elefixed/
Author
Kisnows
Published at
2015-01-22