Skip to content

SPAAAADE/gnb.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

gnb.js

jQuery plugin for GNB navigation and scroll to menu

###Usage HTML Markup

<ul id="gnb">
	<li><a href="#main">Main</a></li>
   	<li><a href="#sub">Sub</a></li>
   	<li><a href="#usage">Usage</a></li>
   	<li><a href="#help">Help</a></li>
</ul>


<div id="WrapDiv">
<div id="main">
	<h1> Main </h1>
    <!-- Contents -->
</div>

<div id="Sub">
	<h1> Sub </h1>
    <!-- Contents -->
</div>
</div>
.
.
.

Javascript

(function ($) {
    $(document).ready(function () {
    	//set  gnb UL element
        var oUl$ = $('ul#gnb');

        oUl$.gnb({
            wrapper: '#WrapDiv', //selector name that wrap contents DIVs
            duration:700,           //scroll animate during time , default 1000
            activeclass: 'on'        // class name that active menu item , default 'active'
        });
    });
})(jQuery);

Options

{
easing       : 'swing', 	  // aniamate easing
duration     : 1000, 		// animate during time
anchor       : 'li a',   		// menu anchor element
exception    : null, 		// except element 
activeclass  : 'active',   // class name that active menu item
wrapper      : null,        // selector name that wrap contents DIVs
bindingwindow: true,   // bind scroll event window that set menu active 
correction   : null         // value of correction ,that scroll offset position
};

Example

About

jQuery plugin for GNB navigation and scroll to menu

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published