All Projects → christophery → Pushy

christophery / Pushy

Licence: mit
Pushy is a responsive off-canvas navigation menu using CSS transforms & transitions.

Programming Languages

HTML
75241 projects
javascript
184084 projects - #8 most used programming language
SCSS
7915 projects
CSS
56736 projects

Projects that are alternatives of or similar to Pushy

Slinky
A light-weight, responsive, mobile-like navigation menu plugin
Stars: ✭ 649 (-56.38%)
Mutual labels:  navigation, menu, jquery
Sidr
Sidr is a jQuery plugin for creating side menus and the easiest way for doing your menu responsive.
Stars: ✭ 2,924 (+96.51%)
Mutual labels:  navigation, menu, jquery
Hc Offcanvas Nav
JavaScript library for creating toggled off-canvas multi-level navigations, allowing endless nesting of submenu elements, supporting swipe gestures, keyboard interactions and ARIA attributes.
Stars: ✭ 201 (-86.49%)
Mutual labels:  navigation, menu, jquery
Jquery Menuflip
Create animated flipping menu links with this extremely lightweight jQuery plugin.
Stars: ✭ 39 (-97.38%)
Mutual labels:  navigation, menu, jquery
Mmenu Js
The best javascript plugin for app look-alike on- and off-canvas menus with sliding submenus for your website and webapp.
Stars: ✭ 2,535 (+70.36%)
Mutual labels:  navigation, menu, off-canvas-menu
React Horizontal Scrolling Menu
Horizontal scrolling menu component for React.
Stars: ✭ 289 (-80.58%)
Mutual labels:  navigation, menu
Django Sitetree
Reusable application for Django introducing site tree, menu and breadcrumbs navigation elements.
Stars: ✭ 330 (-77.82%)
Mutual labels:  navigation, menu
Jquery.localscroll
Animated anchor navigation made easy with jQuery
Stars: ✭ 624 (-58.06%)
Mutual labels:  navigation, jquery
Laravel Menu
Html menu generator for Laravel
Stars: ✭ 650 (-56.32%)
Mutual labels:  navigation, menu
Luxbar
🍸 Featherweight, Responsive, CSS Only Navigation Bar
Stars: ✭ 663 (-55.44%)
Mutual labels:  navigation, menu
Menu
Menu and sidebar management package for Laravel
Stars: ✭ 6 (-99.6%)
Mutual labels:  navigation, menu
Menuspy
A JavaScript library to make navigation menus highlight the item based on currently in view section.
Stars: ✭ 283 (-80.98%)
Mutual labels:  navigation, menu
Stickynavbar.js
stickyNavbar.js: Fancy sticky navigation jQuery plugin with smart anchor link highlighting
Stars: ✭ 279 (-81.25%)
Mutual labels:  navigation, jquery
Hamburger React
Animated hamburger menu icons for React (1.5 KB) 🍔
Stars: ✭ 391 (-73.72%)
Mutual labels:  navigation, menu
Material Bottom Nav
A bottom navigation bar adhering to the Material Design specification.
Stars: ✭ 41 (-97.24%)
Mutual labels:  navigation, menu
Bootstrap Dropdown Hover
Bootstrap based responsive mulltilevel dropdown navigation menu with fascinating animations
Stars: ✭ 115 (-92.27%)
Mutual labels:  navigation, menu
Js Offcanvas
A lightweight, flexible jQuery off-canvas navigation plugin which lets you create fully accessible sidebar or top/bottom sliding (or push) panels with keyboard interactions and ARIA attributes.
Stars: ✭ 272 (-81.72%)
Mutual labels:  navigation, jquery
Eeh Navigation
An AngularJS menu module.
Stars: ✭ 74 (-95.03%)
Mutual labels:  navigation, menu
ml-stack-nav
Customizable, responsive, accessible, easy-to-use multi-level stack navigation menu with slide effect.
Stars: ✭ 20 (-98.66%)
Mutual labels:  navigation, menu
Transformerslayout
🔥 App金刚区导航菜单,类似淘宝、QQ音乐等APP导航,方格布局横向多行滑动翻页带滚动条
Stars: ✭ 258 (-82.66%)
Mutual labels:  navigation, menu

Pushy

Pushy is a responsive off-canvas navigation menu using CSS transforms & transitions. This project was inspired by the off-canvas navigation menu seen on Medium.

Pushy has been implemented on many sites, check them out! Feel free to let me know if you use Pushy in one of your websites.

Pushy has been featured on the Treehouse Show and in a book!

View Demo | Sites using Pushy

Features

  • Uses CSS transforms & transitions.
  • Smooth performance on mobile devices.
  • jQuery animation fallback for IE 7 - 9.
  • Menu closes when a link is selected.
  • Menu closes when the site overlay is selected.
  • Auto-collapsible submenus.
  • Left or right menu position.
  • It's responsive!

Requirements

Install

Download the latest release, this includes everything you need to get Pushy running on your site.

  1. Add the stylesheet (pushy.css) in your head and the JS (pushy.min.js) file in your footer.

  2. If you are using submenus, then you'll need to add the arrow.svg file into your img directory (optional).

  3. Insert the following markup into your body.

<!-- Pushy Menu -->
<nav class="pushy pushy-left">
    <div class="pushy-content">
        <ul>
            <!-- Submenu -->
            <li class="pushy-submenu">
                <button>Submenu</button>
                <ul>
                    <li class="pushy-link"><a href="#">Item 1</a></li>
                    <li class="pushy-link"><a href="#">Item 2</a></li>
                    <li class="pushy-link"><a href="#">Item 3</a></li>
                </ul>
            </li>
            <li class="pushy-link"><a href="#">Item 1</a></li>
            <li class="pushy-link"><a href="#">Item 2</a></li>
        </ul>
    </div>
</nav>

<!-- Site Overlay -->
<div class="site-overlay"></div>

<!-- Your Content -->
<div id="container">
    <!-- Menu Button -->
    <button class="menu-btn">&#9776; Menu</button>
</div>

Development

Pushy CSS and JS are compiled and minified using Grunt. You'll need Node and Grunt installed globally.

From the root directory run:

$ npm install
$ grunt

Now you can edit files in /scss/ and /js/, which will be compiled to /css/pushy.css and /js/pushy.min.js automatically.

CDN

Link directly to Pushy files on cdnjs.

NPM

If your are comfortable with command line, you can install Pushy as a NPM package:

npm install @cmyee/pushy

Options

Menu Position

Use the .pushy-left or .pushy-right CSS class to specify the menu position.

<!-- Pushy will transition from the right -->
<nav class="pushy pushy-right">
    <div class="pushy-content">
        <ul>
            <li class="pushy-link"><a href="#">Item 1</a></li>
            <li class="pushy-link"><a href="#">Item 2</a></li>
        </ul>
    </div>
</nav>

data-focus

Use the data-focus attribute to give focus to a link when the menu is opened. Ideally the first link of the menu should be focused.

This data attribute accepts a CSS selector.

<nav class="pushy pushy-left" data-focus="#home-link">
    <div class="pushy-content">
        <ul>
            <li id="home-page" class="pushy-link"><a href="#">Home</a></li>
            <li class="pushy-link"><a href="#">About Us</a></li>
            <li class="pushy-link"><a href="#">Contact</a></li>
        </ul>
    </div>
</nav>

data-menu-btn-selector

Use the data-menu-btn-selector attribute to change the menu button CSS class for toggling the menu.

By default Pushy will use .menu-btn to toggle the menu.

This data attribute accepts a CSS selector.

Note: In v1.4.0 this attribute was renamed from data-menu-btn-class to data-menu-btn-selector

<!-- Pushy Menu -->
<nav class="pushy pushy-left" data-menu-btn-selector=".my-menu-btn">
	<!-- I've removed the inner markup for brevity -->
</nav>

<!-- Menu Button-->
<button class="my-menu-btn">Menu</button>

data-container-selector

Use the data-container-selector attribute to using a custom #container selector.

If you use a custom #container selector you'll need to update the necessary CSS in pushy.scss.

This data attribute accepts a CSS selector.

<nav class="pushy pushy-right" data-container-selector="#custom-container">

Tips

  • Use the .push CSS class on HTML elements outside of the #container.
<header class="push">
    <h1>This is a Heading</h1>
    <h2>This is a subheading</h2>
</header>

<!-- Your Content -->
<div id="container"></div>
  • If you are using SCSS, you can easily change the menu width by adjusting the $menu_width variable. The SCSS file will need to be compiled to CSS in order to see the change.
$menu_width: 400px;
  • Not using SCSS? You'll have to update the multiple values (or do a find a replace!) in the pushy.css file.
.pushy{
    width: 400px; /* Changed the width to 400px */
}

.pushy-left{
    transform: translate3d(-400px,0,0); /* Updated the values */
    /* Don't forget the vendor prefixes */
}

.pushy-open-left #container,
.pushy-open-left .push {
    transform: translate3d(400px, 0, 0); /* Updated the values */
}

.pushy-right {
    transform: translate3d(400px, 0, 0); /* Updated the values */
    /* Don't forget the vendor prefixes */
}

.pushy-open-right #container,
.pushy-open-right .push {
    transform: translate3d(-400px, 0, 0); /* Updated the values */
    /* Don't forget the vendor prefixes */
}
  • Only links with the CSS class of pushy-link will close the menu.
<nav class="pushy pushy-left">
    <div class="pushy-content">
        <ul>
            <!-- This link will close the menu -->
            <li class="pushy-link"><a href="#">Item 1</a></li>
            <!-- This link won't close the menu -->
            <li><a href="#">Item 2</a></li>
        </ul>
    </div>
</nav>
  • If you want to prevent scrolling of your site when Pushy is open just add overflow-x: hidden and height: 100% to both the html & body tags.
html, body{
    overflow-x: hidden;
    height: 100%;
    -webkit-overflow-scrolling: touch;
}

Browser Compatibility

Desktop Mobile
IE 9-11 Chrome (Android)
MS Edge Safari (iOS)
Chrome
Firefox
Safari (Mac)

Sites using Pushy

Pushy has been implemented on many sites in the wild, check them out!

To add your site, tweet to me @cmyee.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].