Skip to content

Instantly share code, notes, and snippets.

@rafibomb
Created May 2, 2015 04:17
Show Gist options
  • Save rafibomb/c28626183d05eef4cb01 to your computer and use it in GitHub Desktop.
Save rafibomb/c28626183d05eef4cb01 to your computer and use it in GitHub Desktop.
Using Interchange on a mega-menu
<nav class="mega-menu">
<div class="row collapse">
<div class="medium-3 columns">
<img src="assets/img/duality.png" alt="company logo">
</div>
<div class="medium-7 columns">
<ul class="button-group even-3">
<li><a href="#" class="button" data-dropdown="living" data-options="is_hover:true; hover_timeout:500">Living Room Furniture</a></li>
<li><a href="#" class="button" data-dropdown="bedroom" data-options="is_hover:true; hover_timeout:500">Bedroom Room Furniture</a></li>
<li><a href="#" class="button" data-dropdown="storage" data-options="is_hover:true; hover_timeout:500">Storage<br>Furniture</a></li>
</ul>
</div>
</div>
<div class="row">
<div class="medium-12 columns">
<div id="living" data-dropdown-content class="f-dropdown content mega">
<div class="row">
<div class="small-3 columns">
<h4>Shop by Category</h4>
<ul class="categories">
<li><a href="#"><i class="fi-fast-forward"></i>Sofas</a></li>
<li><a href="#"><i class="fi-fast-forward"></i>Beanbags</a></li>
<li><a href="#"><i class="fi-fast-forward"></i>Lounges</a></li>
<li><a href="#"><i class="fi-fast-forward"></i>Comfy Stuff</a></li>
<li><a href="#"><i class="fi-fast-forward"></i>Coffee Tables</a></li>
<li><a href="#"><i class="fi-fast-forward"></i>Poofs</a></li>
</ul>
</div>
<div class="small-5 columns">
<h4>Shop by Style</h4>
<ul class="small-block-grid-3">
<li>
<img src="http://placehold.it/250x150">
<p>Description</p>
</li>
<li>
<img src="http://placehold.it/250x150">
<p>Description</p>
</li>
<li>
<img src="http://placehold.it/250x150">
<p>Description</p>
</li>
<li>
<img src="http://placehold.it/250x150">
<p>Description</p>
</li>
<li>
<img src="http://placehold.it/250x150">
<p>Description</p>
</li>
<li>
<img src="http://placehold.it/250x150">
<p>Description</p>
</li>
</ul>
</div>
<div class="small-4 columns">
<h4>Need Help?</h4>
<form>
<div class="row collapse">
<label>Search Our Inventory</label>
<div class="small-9 columns">
<input type="search" placeholder="find something" />
</div>
<div class="small-3 columns">
<span class="postfix">Search</span>
</div>
</div>
</form>
<h4>Contact Us</h4>
<ul class="contact">
<li><i class="fi-telephone"></i> 1-877-000-0000</li>
<li><i class="fi-mail"></i> [email protected]</li>
<li><i class="fi-social-twitter"></i> @dualityfurniture</li>
</ul>
</div>
</div>
</div>
<div id="bedroom" data-dropdown-content class="f-dropdown content mega">
<div class="row">
<div class="small-3 columns">
<h4>Shop by Category</h4>
<ul class="categories">
<li><a href="#"><i class="fi-fast-forward"></i>Beds</a></li>
<li><a href="#"><i class="fi-fast-forward"></i>Wardrobe</a></li>
<li><a href="#"><i class="fi-fast-forward"></i>Nightstands</a></li>
<li><a href="#"><i class="fi-fast-forward"></i>Mirrors</a></li>
<li><a href="#"><i class="fi-fast-forward"></i>Lamps</a></li>
<li><a href="#"><i class="fi-fast-forward"></i>Duvets</a></li>
</ul>
</div>
<div class="small-5 columns">
<h4>Shop by Style</h4>
<ul class="small-block-grid-3">
<li>
<img src="http://placehold.it/250x150">
<p>Description</p>
</li>
<li>
<img src="http://placehold.it/250x150">
<p>Description</p>
</li>
<li>
<img src="http://placehold.it/250x150">
<p>Description</p>
</li>
<li>
<img src="http://placehold.it/250x150">
<p>Description</p>
</li>
<li>
<img src="http://placehold.it/250x150">
<p>Description</p>
</li>
<li>
<img src="http://placehold.it/250x150">
<p>Description</p>
</li>
</ul>
</div>
<div class="small-4 columns">
<h4>Need Help?</h4>
<form>
<div class="row collapse">
<label>Search Our Inventory</label>
<div class="small-9 columns">
<input type="search" placeholder="find something" />
</div>
<div class="small-3 columns">
<span class="postfix">Search</span>
</div>
</div>
</form>
<h4>Contact Us</h4>
<ul class="contact">
<li><i class="fi-telephone"></i> 1-877-000-0000</li>
<li><i class="fi-mail"></i> [email protected]</li>
<li><i class="fi-social-twitter"></i> @dualityfurniture</li>
</ul>
</div>
</div>
</div>
<div id="storage" data-dropdown-content class="f-dropdown content mega">
<div class="row">
<div class="small-3 columns">
<h4>Shop by Category</h4>
<ul class="categories">
<li><a href="#"><i class="fi-fast-forward"></i>Benches</a></li>
<li><a href="#"><i class="fi-fast-forward"></i>Bookshelves</a></li>
<li><a href="#"><i class="fi-fast-forward"></i>Bookcases</a></li>
<li><a href="#"><i class="fi-fast-forward"></i>Floating Shelves</a></li>
<li><a href="#"><i class="fi-fast-forward"></i>Ottomans</a></li>
<li><a href="#"><i class="fi-fast-forward"></i>Secret Passages</a></li>
</ul>
</div>
<div class="small-5 columns">
<h4>Shop by Style</h4>
<ul class="small-block-grid-3">
<li>
<img src="http://placehold.it/250x150">
<p>Description</p>
</li>
<li>
<img src="http://placehold.it/250x150">
<p>Description</p>
</li>
<li>
<img src="http://placehold.it/250x150">
<p>Description</p>
</li>
<li>
<img src="http://placehold.it/250x150">
<p>Description</p>
</li>
<li>
<img src="http://placehold.it/250x150">
<p>Description</p>
</li>
<li>
<img src="http://placehold.it/250x150">
<p>Description</p>
</li>
</ul>
</div>
<div class="small-4 columns">
<h4>Need Help?</h4>
<form>
<div class="row collapse">
<label>Search Our Inventory</label>
<div class="small-9 columns">
<input type="search" placeholder="find something" />
</div>
<div class="small-3 columns">
<span class="postfix">Search</span>
</div>
</div>
</form>
<h4>Contact Us</h4>
<ul class="contact">
<li><i class="fi-telephone"></i> 1-877-000-0000</li>
<li><i class="fi-mail"></i> [email protected]</li>
<li><i class="fi-social-twitter"></i> @dualityfurniture</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</nav>
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Foundation Mega Menu</title>
<link rel="stylesheet" href="css/app.css" />
<link href="http://cdnjs.cloudflare.com/ajax/libs/foundicons/3.0.0/foundation-icons.css" rel="stylesheet">
<script src="bower_components/modernizr/modernizr.js"></script>
</head>
<body>
<div class="off-canvas-wrap" data-offcanvas>
<div class="inner-wrap">
<!-- this is where the magic happens -->
<div id="swap" data-interchange="[partials/mobile-menu.html, (default)], [partials/desktop-menu.html, (medium)]">
</div>
<div class="row">
<div class="large-4 small-12 columns">
<img src="http://placehold.it/500x500&text=Logo">
<div class="hide-for-small panel">
<h3>Header</h3>
<h5 class="subheader">Risus ligula, aliquam nec fermentum vitae, sollicitudin eget urna. Donec dignissim nibh fermentum odio ornare sagittis.
</h5>
</div>
<a href="#">
<div class="panel callout radius">
<h6>99  items in your cart</h6>
</div>
</a>
</div>
<div class="large-8 columns">
<div class="row">
<div class="large-4 small-6 columns">
<img src="http://placehold.it/1000x1000&text=Thumbnail">
<div class="panel">
<h5>Item Name</h5>
<h6 class="subheader">$000.00</h6>
</div>
</div>
<div class="large-4 small-6 columns">
<img src="http://placehold.it/500x500&text=Thumbnail">
<div class="panel">
<h5>Item Name</h5>
<h6 class="subheader">$000.00</h6>
</div>
</div>
<div class="large-4 small-6 columns">
<img src="http://placehold.it/500x500&text=Thumbnail">
<div class="panel">
<h5>Item Name</h5>
<h6 class="subheader">$000.00</h6>
</div>
</div>
<div class="large-4 small-6 columns">
<img src="http://placehold.it/500x500&text=Thumbnail">
<div class="panel">
<h5>Item Name</h5>
<h6 class="subheader">$000.00</h6>
</div>
</div>
<div class="large-4 small-6 columns">
<img src="http://placehold.it/500x500&text=Thumbnail">
<div class="panel">
<h5>Item Name</h5>
<h6 class="subheader">$000.00</h6>
</div>
</div>
<div class="large-4 small-6 columns">
<img src="http://placehold.it/500x500&text=Thumbnail">
<div class="panel">
<h5>Item Name</h5>
<h6 class="subheader">$000.00</h6>
</div>
</div>
</div>
</div>
<div class="row">
<div class="large-12 columns">
<div class="panel">
<div class="row">
<div class="large-2 small-6 columns">
<img src="http://placehold.it/300x300&text=Site Owner">
</div>
<div class="large-10 small-6 columns">
<strong>This Site Is Managed By<hr/></strong>
Risus ligula, aliquam nec fermentum vitae, sollicitudin eget urna. Donec dignissim nibh fermentum odio ornare sagittis
</div>
</div>
</div>
</div>
</div>
</div>
<footer class="row">
<div class="large-12 columns"><hr/>
<div class="row">
<div class="large-6 columns">
<p>© Copyright no one at all. Go to town.</p>
</div>
<div class="large-6 columns">
<ul class="inline-list right">
<li><a href="#">Link 1</a></li>
<li><a href="#">Link 2</a></li>
<li><a href="#">Link 3</a></li>
<li><a href="#">Link 4</a></li>
</ul>
</div>
</div>
</div>
</footer>
</div>
</div>
<script src="bower_components/jquery/dist/jquery.min.js"></script>
<script src="bower_components/foundation/js/foundation.min.js"></script>
<script src="js/app.js"></script>
</body>
</html>
<nav class="tab-bar">
<section class="left-small">
<a class="left-off-canvas-toggle menu-icon" href="#"><span></span></a>
</section>
<section class="middle tab-bar-section">
<h1 class="title">Foundation</h1>
</section>
</nav>
<aside class="left-off-canvas-menu">
<ul class="off-canvas-list">
<li><label>Foundation</label></li>
<li><a href="#">The Psychohistorians</a></li>
<li><a href="#">...</a></li>
</ul>
</aside>
<a class="exit-off-canvas"></a>
</div>
</div>
$(document).foundation();
$("#swap").on("replace", function() {
$(document).foundation();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment