Created
June 17, 2011 13:18
-
-
Save bullfight/1031403 to your computer and use it in GitHub Desktop.
Menu rewrite
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* =Menu | |
-------------------------------------------------------------- */ | |
@mixin nav_elements($elements, $widths, $height) { | |
// loop through elements | |
@for $i from 1 through length($elements) { | |
$offset: 0px; | |
// offset: add widths left to right | |
@if $i > 1{ | |
@for $ii from 1 through ($i - 1) { | |
$offset: $offset - nth($widths, $ii); } | |
} | |
ul li.nav_#{nth($elements, $i)} a { width: nth($widths, $i); } | |
ul li.nav_#{nth($elements, $i)} a:hover { background: url(images/mainnav.gif) no-repeat $offset (-1 * $height); } | |
} | |
} | |
div.menu { | |
// Menu Parameters | |
$nav-height: 72px; | |
$menu-height: 33px; | |
$menu-width: 570px; | |
$menu-padding: 22px; | |
$menu-elements: home, bio, shows, music, video, photos, store; // name of each element in order | |
$menu-element-width: 86px, 55px, 62px, 82px, 88px, 103px, 94px; //width of each element in order | |
width: $menu-width; height: $nav-height; float: left; margin: 0 auto; padding: $menu-padding 0 0 0; | |
ul { width: $menu-width; height: $menu-height; margin: 0; padding: 0; float: left; background: url(images/mainnav.gif) no-repeat top left; } | |
ul li { list-style-type: none; float: left; margin: 0; padding: 0; display: inline; height: $menu-height; } | |
ul li a { display: block; height: $menu-height; text-indent: -9999px; outline: none; margin: 0; } | |
@include nav_elements($menu-elements, $menu-element-width, $menu-height) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment