Template:Paris2009 menu5
From 2009.igem.org
(Difference between revisions)
Christophe.R (Talk | contribs) |
Christophe.R (Talk | contribs) |
||
Line 4: | Line 4: | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | ||
<style type="text/css"> | <style type="text/css"> | ||
- | + | ||
- | + | #navigation { | |
- | + | width: 110px; | |
- | + | margin: 20px 13px 0 7px; | |
- | + | position: relative; | |
- | + | float: left; | |
- | + | padding:0; | |
- | + | list-style: none; | |
- | + | } | |
- | #navigation a, #navigation span { | + | |
- | + | #navigation a, #navigation span { | |
- | + | display: block; | |
- | + | width: 110px; | |
- | + | height: 19px; | |
- | + | color: #e4e4e4; | |
- | + | padding:0; | |
- | #navigation .toggleSubMenu a, #navigation .toggleSubMenu span { | + | outline: none; |
- | + | } | |
- | + | ||
- | #navigation .open a, #navigation .open span { | + | #navigation .toggleSubMenu a, #navigation .toggleSubMenu span { |
- | + | background-image: url(https://static.igem.org/mediawiki/2009/7/7c/Menu_Paris.png); | |
- | + | } | |
- | #navigation a:hover, #navigation a:focus, #navigation a:active { | + | |
- | + | #navigation .open a, #navigation .open span { | |
- | + | background-image: url(https://static.igem.org/mediawiki/2009/7/7c/Menu_Paris.png); | |
- | #navigation .subMenu { | + | } |
- | + | ||
- | + | #navigation a:hover, #navigation a:focus, #navigation a:active { | |
- | + | text-decoration: underline; | |
- | + | } | |
- | + | ||
- | + | #navigation .subMenu { | |
- | + | background: url(https://static.igem.org/mediawiki/2009/9/9a/Menu_sub_Paris.png); | |
- | #navigation ul.subMenu a { | + | margin: 0; |
- | + | padding: 0; | |
- | + | color:white; | |
- | + | border-bottom: 1px solid #666; | |
- | + | } | |
- | + | ||
- | + | #navigation ul.subMenu a { | |
- | + | background: none; | |
- | + | padding: 3px 20px; | |
- | + | } | |
- | + | ||
- | + | </style> | |
- | <script type="text/javascript" src="http://www.alsacreations.com/xmedia/tuto/exemples/accordeon/jquery-1.2.1.js"></script> | + | <!--[if lte IE 6]> |
+ | <style type="text/css"> | ||
+ | li { | ||
+ | height: 1px; | ||
+ | } | ||
+ | </style> | ||
+ | <![endif]--> | ||
+ | |||
+ | <script type="text/javascript" src="http://www.alsacreations.com/xmedia/tuto/exemples/accordeon/jquery-1.2.1.js"></script> | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
<!-- | <!-- | ||
$(document).ready( function () { | $(document).ready( function () { | ||
- | // | + | // Hide subMenu |
- | // | + | // Exept the "open_at_load" : |
$("ul.subMenu:not('.open_at_load')").hide(); | $("ul.subMenu:not('.open_at_load')").hide(); | ||
// On selectionne tous les items de liste portant la classe "toggleSubMenu" | // On selectionne tous les items de liste portant la classe "toggleSubMenu" | ||
- | // | + | // replace by span: |
$("li.toggleSubMenu span").each( function () { | $("li.toggleSubMenu span").each( function () { | ||
// On stocke le contenu du span : | // On stocke le contenu du span : | ||
Line 65: | Line 73: | ||
} ) ; | } ) ; | ||
- | // | + | // modify "click" on link listed in class "toggleSubMenu" : |
- | + | ||
$("li.toggleSubMenu > a").click( function () { | $("li.toggleSubMenu > a").click( function () { | ||
- | // | + | // if subMenu is already open, we close it : |
if ($(this).next("ul.subMenu:visible").length != 0) { | if ($(this).next("ul.subMenu:visible").length != 0) { | ||
$(this).next("ul.subMenu").slideUp("normal", function () { $(this).parent().removeClass("open") } ); | $(this).next("ul.subMenu").slideUp("normal", function () { $(this).parent().removeClass("open") } ); | ||
} | } | ||
- | // | + | // if subMenu is hided, we close them : |
else { | else { | ||
$("ul.subMenu").slideUp("normal", function () { $(this).parent().removeClass("open") } ); | $("ul.subMenu").slideUp("normal", function () { $(this).parent().removeClass("open") } ); | ||
$(this).next("ul.subMenu").slideDown("normal", function () { $(this).parent().addClass("open") } ); | $(this).next("ul.subMenu").slideDown("normal", function () { $(this).parent().addClass("open") } ); | ||
} | } | ||
- | |||
return false; | return false; | ||
}); | }); | ||
} ) ; | } ) ; | ||
- | + | // --> | |
- | + | </script> | |
- | + | ||
</head> | </head> | ||
<body> | <body> |
Revision as of 16:10, 6 October 2009