Responsive jQuery Sticky Element Plugin pinBox - Download Responsive jQuery Sticky Element Plugin - pinBox

Download Responsive jQuery Sticky Element Plugin – pinBox

Posted on

This time I will share jQuery Plugin and tutorial about Responsive jQuery Sticky Element Plugin – pinBox, hope it will help you in programming stack.

Responsive jQuery Sticky Element Plugin pinBox - Download Responsive jQuery Sticky Element Plugin - pinBox
File Size: 8.76 KB
Views Total: 1404
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

pinBox is a lightweight, customizable jQuery plugin for creating sticky element that makes a block of content follow you as you scroll down the webpage. You can specify the breakpoint to disable the plugin in small screen devices like mobile and tablet.

Basic usage:

1. Add a CSS class to the element that will be sticky on vertical page scrolling.

1 <div class="pinBox">
2   I'm sticky
3 </div>

2. Add the required ID ‘pinBoxContainer’ to the parent container. Make sure to add position:relative if the parent container has float property. The whole markup structure should be like this:

1 <div class="container" id="pinBoxContainer">
2   <div class="pinBox">
3     I'm sticky
4   </div>
5    
6   <div>
7     Main content goes here
8   </div>
9 </div>

3. Include jQuery library and the jQuery pinBox plugin at the bottom of the webpage.

1 <script src="//code.jquery.com/jquery-1.12.0.min.js"></script>
2 <script src="jquery.pinBox.js"></script>

4. Active the plugin with default settings.

1 $(".pinBox").pinBox();

5. All available settings with default values.

01 $(".pinBox").pinBox({
02  
03   // CSS class of parent container
04   Container : '.container',
05  
06   // top offset in pixels
07   Top : 0,
08  
09   // z-index in pixels
10   ZIndex : 20,
11  
12   // breakpoint to disable the plugin
13   MinWidth : '767px'
14    
15 });

6. Callback events.

1 Events : function(e){
2   console.log(e);
3   // e.current => current scroll top [number]
4   // e.direction => scroll down or up [up,down]
5   // e.width => window width [number]
6   // e.active => if pinBox active [true,false]
7   // e.disabled => if window width < MinWidth pinBox will disabled [true, false]
8 }

Change log:

2016-03-09

  • Update jquery.pinBox.js

This awesome jQuery plugin is developed by NeZaMy. For more Advanced Usages, please check the demo page or visit the official website.

source : jqueryscript.net