Floating Action Button Plugin jQuery Docked Link - Download Dead Simple Floating Action Button Plugin - jQuery Docked Link

Download Dead Simple Floating Action Button Plugin – jQuery Docked Link

Posted on

This time I will share jQuery Plugin and tutorial about Dead Simple Floating Action Button Plugin – jQuery Docked Link, hope it will help you in programming stack.

Floating Action Button Plugin jQuery Docked Link - Download Dead Simple Floating Action Button Plugin - jQuery Docked Link
File Size: 37.1 KB
Views Total: 1616
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

Docked Link is a really simple jQuery plugin used to create a floating link that will always stay at the center-left or center-right as you scroll down or up the web page. Ideal for sticky action buttons such as social sharing, email subscription, etc.

How to use it:

1. Include the JavaScript file docked-link.js after the latest jQuery library.

1 <script src="//code.jquery.com/jquery-3.2.1.slim.min.js"></script>
2 <script src="docked-link.js"></script>

2. Create the docked link as this. Best practice: place below the fold to avoid visible DOM manipulation.

1 <a id="myLink" href="https://www.jqueryscript.net">Link To jQueryScript</a>

3. Apply your own CSS styles to the docked link.

01 #myLink {
02   display: block;
03   width: 120px;
04   padding: 8px 8px 8px 14px;
05   background :#2980B9;
06   color: #fff;
07   text-decoration: none;
08   text-align: center;
09   line-height: 20px;
10   border-top-right-radius: 11px;
11   border-bottom-right-radius: 11px;
12 }

4. Activate the docked link with default settings.

1 $('#myLink').dockedLink();

5. Set the initial position from the top of the webpage.

1 $('#myLink').dockedLink({
2   pixelsFromTop: 1000
3 });

6. Change the default position of the docked link.

1 $('#myLink').dockedLink({
2   position: 'right' // or 'left'
3 });

Changelog:

2019-05-03

  • If the element is invisible, keep it invisible.

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

source : jquery.net