Box Lid Menu

Box Lid Menu inspired by Toybox.

View the Project on GitHub jimjh/box-lid

Demo

You can see the Box Lid Menu in action by hovering your mouse over the menu bar on the left.

This jQuery plugin creates the box lid effect for navigation menus, and is inspired by Toybox. Here is a simple demo.

Installation

First, include the stylesheet and javascript as follows:

<link rel='stylesheet' type='text/css' href='css/box-lid.css'>
<script src='js/box-lid.js'></script>

Next, create the following HTML structure:

  <div class='box-lid-menu'>
    <div class='box-lid-icon'></div>
    <nav>
      <!-- NAVIGATION CONTENTS -->
    </nav>
  </div>
  <div class='box-lid'>
    <div class='box-lid-content'>
      <!-- MAIN CONTENT -->
    </div>
  </div>

Finally, invoke $('.box-lid-menu').boxLid() where appropriate. The most common usage should be

$(function() {
  $('.box-lid-menu').boxLid();
});
  • TODO release plugin

Configuration

There are three ways to configure the menu.

SCSS

If you use SCSS, simply override the configuration variables before importing sass/box-lid.scss. For example,

$box-lid-background: #ccc;
@import 'box-lid';

Refer to the beginning of sass/box-lid.scss for the complete list of configuration variables.

CSS

If the above method is not your cup of tea, you can also choose to override the CSS. Unfortunately this method is terribly brittle.