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.jsfile 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.
