Giter VIP home page Giter VIP logo

basicresponsivemenu's Introduction

basicResponsiveMenu

This plugin gives you a responsive menu with as little hassle as possible.

The demo folder contains a demo index.html file, showing example markup. The plugin files are located in the root folder.

How To Use

Markup

Essentially, all you need to do is to add the class response--main-navigation to the wrapper around your menu, and the class response--site-menu to the menu itself.

Example:

<nav class="response--main-navigation">
	<ul class="response--site-menu">
		<li><a href="#">HOME</a></li>
		<li><a href="#">About Us</a></li>
		<li><a href="#">Products</a></li>
		<li><a href="#">Cases</a></li>
		<li><a href="#">Contact</a></li>
	</ul>
</nav>

Setup

The plugin consists of a JS and a CSS file, and the only dependency you need to install is jQuery.

In the <head> section, include: <link rel="stylesheet" href="PATH_TO_PLUGIN_CSS/basicResponsiveMenu.css">

Either in the <head> section, or before the closing <body> tag, include: <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> and <script src="PATH_TO_PLUGIN_JS/basicResponsiveMenu.js"></script>

You initialize the plugin with:

<script>
$(function(){
	$('.response--main-navigation').basicResponsiveMenu();
});
</script>

If you wish to change the default options, you can do it as follows:

$('.response--main-navigation').basicResponsiveMenu({
	browserWidth:960,
	slideDir:'left',
	slideSpeed:400
});

Options

There's four different options available, listed below with their default values:

browserwidth: 768,        // At which screen size do you want to transition from a horizontal to a hamburger menu?
animate:      true,       // Do you want the menu to animate in, or simply appear?
slideDir:     'right',    // which direction do you want the menu to slide to? 'right' or 'left'?
slideSpeed:   250         // the speed with which the menu slides in, set in ms

Styling

The plugin CSS file only contains the most basic styling needed for the plugin to work. The design part is up to you, depending on what fits with your needs.

Happy coding. ๐Ÿ˜ƒ

basicresponsivemenu's People

Contributors

katrine-marie avatar

Watchers

 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.