Skip to content

Instantly share code, notes, and snippets.

/* Responsive Navigation
---------------------------------------------------------------------------------------------------- */
/* Standard Navigation
--------------------------------------------- */
nav {
clear: both;
}
( function( window, $, undefined ) {
'use strict';
$( 'nav' ).before( '<button class="c-hamburger c-hamburger--htx" role="button" aria-pressed="false"><span>toggle menu</span></button>' ); // Add toggles to menus
$( 'nav .sub-menu' ).before( '<button class="sub-menu-toggle" role="button" aria-pressed="false"></button>' ); // Add toggles to sub menus
// Show/hide the navigation
$( '.c-hamburger, .sub-menu-toggle' ).on( 'click', function() {
var $this = $( this );
$this.attr( 'aria-pressed', function( index, value ) {
@netviperinc
netviperinc / Animated Icon Option 2
Created June 23, 2015 17:31
Hamburger Option 2
.c-hamburger--htx {
background-color: #ff3264;
}
.c-hamburger--htx span {
transition: background 0s 0.3s;
}
.c-hamburger--htx span::before,
.c-hamburger--htx span::after {
@netviperinc
netviperinc / hambuger-common-css
Created June 23, 2015 17:28
common css files for animated icon
.c-hamburger {
display: block;
position: relative;
overflow: hidden;
margin: 0;
padding: 0;
width: 96px;
height: 96px;
font-size: 0;
text-indent: -9999px;
<?php
//* Load Font Awesome
add_action( 'wp_enqueue_scripts', 'enqueue_font_awesome' );
function enqueue_font_awesome() {
wp_enqueue_style( 'font-awesome', '//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css' );
}