fixed in page navigation scrollspy - Free Download Fixed In-page Navigation With ScrollSpy - jQuery Right-Nav

Free Download Fixed In-page Navigation With ScrollSpy – jQuery Right-Nav

Posted on

This time I will share jQuery Plugin and tutorial about Fixed In-page Navigation With ScrollSpy – jQuery Right-Nav, hope it will help you in programming stack.

fixed in page navigation scrollspy - Free Download Fixed In-page Navigation With ScrollSpy - jQuery Right-Nav
File Size: 21.1 KB
Views Total: 516
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

The Right-Nav jQuery plugin automatically generates a floating in-page navigation panel containing internal links generated from heading elements within the document.

The goal of the plugin is to provide a user- and SEO-friendly in-page navigation experience (aka: table of contents) by combining the Affix and ScrollSpy functionalities.

How It Works:

  1. Search through all heading elements within the document.
  2. Add unique IDs to heading elements.
  3. Generates anchor links pointing to the heading elements.
  4. Add an ‘Active’ class to the current menu item when you scrolled to the related content.

How to use it:

1. Create an empty unordered list to place the in-page navigation.

1 <ul class="right-nav" id="right-nav-box">
2 </ul>

2. Load the main JavaScript file right-nav.js after jQuery.

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

3. The example CSS styles for the in-page navigation.

01 .right-nav::-webkit-scrollbar {
02   width:6px;
03   height:6px;
04 }
05  
06 .right-nav::-webkit-scrollbar-track {
07   border-radius:3px;
08   background:rgba(0,0,0,0.06);
09   -webkit-box-shadow:inset 0 0 5px rgba(0,0,0,0.08);
10 }
11  
12 .right-nav::-webkit-scrollbar-thumb {
13   border-radius:3px;
14   background:rgba(0,0,0,0.12);
15   -webkit-box-shadow:inset 0 0 10px rgba(0,0,0,0.2);
16 }
17  
18 .right-nav {
19   padding:10px 0 0 0;
20   position:fixed;
21   right:0;
22   font-size:12px;
23   display:none;
24   background-color:#eee;
25   overflow:auto;
26   max-height:650px;
27 }
28  
29 .right-nav .item {
30   margin:0;
31   padding:0;
32   font-size:14px;
33   line-height:1.3;
34   list-style:none;
35 }
36  
37 .right-nav .item a {
38   display:block;
39   position:relative;
40   padding:4px 0 4px 0;
41   white-space:nowrap;
42   overflow:hidden;
43   text-overflow:ellipsis;
44   color:inherit;
45 }
46  
47 .right-nav .active {
48   color:#007fff;
49   background-color:#fff;
50   transition:all ease 0.2s;
51 }

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

source : jquery.net