Template:Mexico-UNAM-CINVESTAV-HEADER

From 2010.igem.org

(Difference between revisions)
Line 4: Line 4:
$(document).ready(function(){
$(document).ready(function(){
-
$("ul.subnav").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled (Adds empty span tag after ul.subnav*)
+
$("ul.subnav").parent().append("<span></span>");  
-
$("ul.topnav li span").click(function() { //When trigger is clicked...
+
$("ul.topnav li span").click(function() {  
//Following events are applied to the subnav itself (moving subnav up and down)
//Following events are applied to the subnav itself (moving subnav up and down)
-
$(this).parent().find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click
+
$(this).parent().find("ul.subnav").slideDown('fast').show();  
-
 
+
$(this).parent().hover(function() {
$(this).parent().hover(function() {
}, function(){
}, function(){
-
$(this).parent().find("ul.subnav").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
+
$(this).parent().find("ul.subnav").slideUp('slow');  
});
});
-
 
//Following events are applied to the trigger (Hover events for the trigger)
//Following events are applied to the trigger (Hover events for the trigger)
}).hover(function() {
}).hover(function() {
-
$(this).addClass("subhover"); //On hover over, add class "subhover"
+
$(this).addClass("subhover");  
}, function(){ //On Hover Out
}, function(){ //On Hover Out
-
$(this).removeClass("subhover"); //On hover out, remove class "subhover"
+
$(this).removeClass("subhover");  
});
});
Line 100: Line 98:
<body>
<body>
<ul class="topnav">
<ul class="topnav">
-
     <li><a href="#">Start</a></li>
+
     <li><a href="#"><img src="http://icons.iconarchive.com/icons/zeusbox/christmas/256/snow-flake-icon.png" width=20 height=20> Start </a></li>
     <li>
     <li>
         <a href="#">Project</a>
         <a href="#">Project</a>
         <ul class="subnav">
         <ul class="subnav">
-
             <li><a href="#">Where the idea Begins</a></li>
+
             <li><a href="#"> Where the idea Begins</a></li>
             <li><a href="#">Sub Nav Link</a></li>
             <li><a href="#">Sub Nav Link</a></li>
         </ul>
         </ul>

Revision as of 10:01, 2 September 2010