Giter Site home page Giter Site logo

mominulbd / stellarnav Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vinnymoreira/stellarnav

0.0 1.0 0.0 15 KB

jQuery responsive multi-level dropdown menu designed to do most of the heavy CSS work for you.

License: MIT License

CSS 43.69% HTML 22.15% JavaScript 34.17%

stellarnav's Introduction

StellarNav.js

jQuery responsive multi-level dropdown menu designed to do most of the heavy CSS work for you.

Click here to see a live demo.

Installation

CSS

Include FontAwesome for the menu icons and the StellarNav stylesheet.

<link rel="stylesheet" type="text/css" media="all" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" media="all" href="css/stellarnav.min.css">

HTML

Add a stellarnav class to your menu div.

<div class="stellarnav">
     <ul>
        <li><a href="#">Item</a></li>
        <li><a href="#">Item</a></li>
        <li><a href="#">Item</a></li>
     </ul>
</div>

Javascript

Include stellarnav.min.js and call stellarNav().

<script type="text/javascript" src="js/stellarnav.js"></script>
<script type="text/javascript">
	jQuery(document).ready(function($) {
		jQuery('.stellarnav').stellarNav();
	});
</script>

Options

Here's a list of available settings.

jQuery('.stellarnav').stellarNav({
	theme     : 'plain',
	breakpoint: 768,
	phoneBtn: false,
	locationBtn: false,
	sticky     : false,
	position: 'static',
	showArrows: true,
	closeBtn     : false,
	scrollbarFix: false
});	
Attribute Type Default Description
theme String plain Adds default color to nav. [plain, light, dark]
breakpoint Integer 768 Number in pixels to determine when the nav should turn mobile friendly.
phoneBtn String false Adds a click-to-call phone link to the top of menu - i.e.: "18009084500".
locationBtn String false Adds a location link to the top of menu - i.e.: "/location/", "http://site.com/contact-us/".
sticky Boolean false Makes nav sticky on scroll.
position String static [static, top] - When set to 'top', this forces the mobile nav to be placed absolutely on the very top of page.
showArrows Boolean true Shows dropdown arrows next to the items that have sub menus.
closeBtn Boolean false Adds a close button to the end of nav.
scrollbarFix Boolean false Fixes horizontal scrollbar issue on very long navs.

Extra

For long dropdown menus towards the last navigation items, you may use the class drop-left to the list item so that the dropdown drops leftward. This prevents menu from breaking the grid and getting a horizontal scrollbar.

<div class="stellarnav">
     <ul>
        <li><a href="#">Item</a></li>
        <li><a href="#">Item</a></li>
        <li><a href="#">Item</a></li>
        <li><a href="#">Item</a></li>
        <li class="drop-left"><a href="#">Last Dropdown Item</a>
        	<ul>
        		<li><a href="#">Item</a></li>
        		<li><a href="#">Item</a>
        			<ul>
        				<li><a href="#">Drop left menu item</a></li>
        				<li><a href="#">Drop left menu item</a></li>
        			</ul>
        		</li>
        	</ul>
        </li>
     </ul>
</div>

If this is not an option and you are still getting a scrollbar, you may also set the scrollbarFix option to true.

stellarnav's People

Contributors

vinnymoreira avatar

Watchers

Mominul Islam avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.