User:Vinoo/AccordionMenu

From 2014.igem.org

< User:Vinoo(Difference between revisions)
m
m
 
(One intermediate revision not shown)
Line 1: Line 1:
<html>
<html>
-
 
-
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
 
-
<script type="text/javascript">
 
-
$(document).ready( function() {
 
-
 
-
// initialize accordion
 
-
$('#acc_menu ul').each( function() {
 
-
var currentURI = window.location.href;
 
-
var links = $('a', this);
 
-
var collapse = true;
 
-
for (var i = 0; i < links.size(); i++) {
 
-
var elem = links.eq(i);
 
-
var href = elem.attr('href');
 
-
var hrefLength = href.length;
 
-
var compareTo = currentURI.substr(-1*hrefLength);
 
-
 
-
if (href == compareTo) {
 
-
collapse = false;
 
-
break;
 
-
}
 
-
};
 
-
if (collapse) {
 
-
$(this).hide();
 
-
}
 
-
});
 
-
 
-
// on click, show this element and hide all others
 
-
$('#acc_menu > li').click( function() {
 
-
var me = $(this).children('ul');
 
-
$('#acc_menu ul').not(me).slideUp();
 
-
me.slideDown();
 
-
});
 
-
});
 
-
</script>
 
-
 
-
 
<style type="text/css">
<style type="text/css">
#acc_menu,
#acc_menu,
Line 63: Line 27:
}
}
-
.sub_menu li a {
+
#sub_menu li a {
     color: #000;
     color: #000;
     height: 25;
     height: 25;
Line 70: Line 34:
}
}
-
#acc_menu li > .sub_menu {
+
#acc_menu li > #sub_menu {
     height: 0;
     height: 0;
     overflow: hidden;
     overflow: hidden;
Line 81: Line 45:
}
}
   
   
-
#acc_menu li:target > .sub_menu {
+
#acc_menu li:target > #sub_menu {
     min-height: 75px;
     min-height: 75px;
}
}
Line 91: Line 55:
}
}
   
   
-
.sub_menu li:hover a { background: #d9f5aa; }
+
#sub_menu li:hover a { background: #d9f5aa; }
</style>
</style>
Line 97: Line 61:
<li id="one"><a href="#one">Art & Design</a>
<li id="one"><a href="#one">Art & Design</a>
-
<ul class="sub_menu">
+
<ul id="sub_menu">
<li><a href="#">Information</a>
<li><a href="#">Information</a>
<li><a href="#">Track Committee</a>
<li><a href="#">Track Committee</a>
Line 105: Line 69:
<li id="two"><a href="#two">Community Labs</a>
<li id="two"><a href="#two">Community Labs</a>
-
<ul class="sub_menu">
+
<ul id="sub_menu">
<li><a href="#">Information</a>
<li><a href="#">Information</a>
<li><a href="#">Track Committee</a>
<li><a href="#">Track Committee</a>
Line 113: Line 77:
<li id="three"><a href="#three">Entrepreneurship</a>
<li id="three"><a href="#three">Entrepreneurship</a>
-
<ul class="sub_menu">
+
<ul id="sub_menu">
<li><a href="#">Information</a>
<li><a href="#">Information</a>
<li><a href="#">Track Committee</a>
<li><a href="#">Track Committee</a>
Line 121: Line 85:
<li id="four"><a href="#four">Measurement</a>
<li id="four"><a href="#four">Measurement</a>
-
<ul class="sub_menu">
+
<ul id="sub_menu">
<li><a href="#">Information</a>
<li><a href="#">Information</a>
<li><a href="#">Track Committee</a>
<li><a href="#">Track Committee</a>
Line 129: Line 93:
<li id="five"><a href="#five">Microfluidics</a>
<li id="five"><a href="#five">Microfluidics</a>
-
<ul class="sub_menu">
+
<ul id="sub_menu">
<li><a href="#">Information</a>
<li><a href="#">Information</a>
<li><a href="#">Track Committee</a>
<li><a href="#">Track Committee</a>
Line 137: Line 101:
<li id="six"><a href="#six">Policy & Practices</a>
<li id="six"><a href="#six">Policy & Practices</a>
-
<ul class="sub_menu">
+
<ul id="sub_menu">
<li><a href="#">Information</a>
<li><a href="#">Information</a>
<li><a href="#">Track Committee</a>
<li><a href="#">Track Committee</a>
Line 145: Line 109:
<li id="seven"><a href="#seven">Software</a>
<li id="seven"><a href="#seven">Software</a>
-
<ul class="sub_menu">
+
<ul id="sub_menu">
<li><a href="#">Information</a>
<li><a href="#">Information</a>
<li><a href="#">Track Committee</a>
<li><a href="#">Track Committee</a>

Latest revision as of 20:04, 12 December 2013