Skip to content

Commit

Permalink
added down arrows
Browse files Browse the repository at this point in the history
  • Loading branch information
tessalt committed Sep 5, 2012
1 parent 34de4b6 commit 79fe205
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 3 deletions.
Binary file added images/downArrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/upArrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<a class="toggleMenu" href="#">Menu</a>
<ul class="nav">
<li class="test">
<a href="#" class="parent" >Shoes</a>
<a href="#">Shoes</a>
<ul>
<li>
<a href="#">Womens</a>
Expand Down Expand Up @@ -188,6 +188,9 @@
</li>
</ul>
</li>
<li>
<a href="#">Shipping Info</a>
</li>
</ul>
</div>

Expand Down
6 changes: 6 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
var adjustMenu = function() {

$(".nav li a").each(function() {
if ($(this).next().length > 0) {
$(this).addClass("parent");
};
})

$(".toggleMenu").click(function(e) {
// can't use toggle because we don't know original state
e.preventDefault();
Expand Down
16 changes: 14 additions & 2 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,22 @@ a {text-decoration: none;}
}
.nav > li {
position: relative;
background: #175e4c;
float: left;
border-top: 1px solid #104336;
}
.nav > li > .parent {
background-image: url("images/downArrow.png");
background-repeat: no-repeat;
background-position: right;
}
.nav > li > a {
display: block;
}
.nav > li > ul {
position: absolute;
left: -9999px;

}

.nav > li.hover > ul {
left: 0;
}
Expand Down Expand Up @@ -79,6 +83,14 @@ a {text-decoration: none;}
.nav > li {
float: none;
}
.nav > li > .parent {
background-position: 95% 50%;
}
.nav li li .parent {
background-image: url("images/downArrow.png");
background-repeat: no-repeat;
background-position: 95% 50%;
}
.nav ul {
display: block;
width: 100%;
Expand Down

0 comments on commit 79fe205

Please sign in to comment.