Team:DTU-Denmark/Templates/Standard page begin

From 2011.igem.org

(Difference between revisions)
Line 37: Line 37:
     <!-- Sexy Drop Down (drop down navigation) -->
     <!-- Sexy Drop Down (drop down navigation) -->
     <script type="text/javascript">
     <script type="text/javascript">
-
         $(document).ready(function(){
+
         $(document).ready(
-
            $("ul.subnav").parent().find("> a").append("<span> ▼</span>"); //Only shows drop down trigger when js is enabled (Adds empty span tag after ul.subnav*)
+
            function(){
-
            $("ul.topnav li").hover(function() { //When trigger is clicked...
+
                $("ul.subnav").parent().find("> a").append("<span> ▼</span>");
-
                //Following events are applied to the subnav itself (moving subnav up and down)
+
                $("ul.topnav li").hover(
-
                $(this).find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click
+
                    function() {
-
                $(this).hover(function() {
+
                        // Hover over
-
                }, function(){
+
                        $(this).find("ul.subnav").stop(true, true).show();
-
                    $(this).parent().find("ul.subnav").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
+
                        // Hover out
-
                });
+
                        $(this).hover(
-
                //Following events are applied to the trigger (Hover events for the trigger)
+
                            function() {
-
                }).hover(function() {
+
                            },
-
                    $(this).addClass("subhover"); //On hover over, add class "subhover"
+
                            function(){
-
                }, function(){  //On Hover Out
+
                                $(this).find("ul.subnav").slideUp('slow');
-
                    $(this).removeClass("subhover"); //On hover out, remove class "subhover"
+
                            }
-
             });
+
                        );
-
         });
+
                    },
 +
                    function(){
 +
                        $(this).find("ul.subnav").slideUp('slow');
 +
                    }
 +
 
 +
                );
 +
             }
 +
         );
     </script>
     </script>

Revision as of 10:44, 18 September 2011

{{{1}}}