Team:UNITN-Trento/JS/Subs/Header

From 2013.igem.org

(Difference between revisions)
(Created page with " //Javascript here $(document).ready(function() { //Open the submenu $("#tn-menu li").mouseenter(function(e) { e.preventDefault(); $(this).children("ul").slideD...")
(add .stop())
Line 1: Line 1:
-
//Javascript here
+
//Javascript here
-
$(document).ready(function() {
+
$(document).ready(function() {
-
//Open the submenu
+
//Open the submenu
-
$("#tn-menu li").mouseenter(function(e) {
+
$("#tn-menu li").mouseenter(function(e) {
-
e.preventDefault();
+
e.preventDefault();
-
$(this).children("ul").slideDown();
+
$(this).children("ul").stop().slideDown();
-
});
+
});
-
//Close the submenu
+
//Close the submenu
-
$("#tn-menu li").mouseleave(function(e) {
+
$("#tn-menu li").mouseleave(function(e) {
-
e.preventDefault();
+
e.preventDefault();
-
$(this).children("ul").slideUp();
+
$(this).children("ul").stop().slideUp();
-
});
+
});
-
});
+
});

Revision as of 09:30, 8 July 2013

//Javascript here $(document).ready(function() {

//Open the submenu $("#tn-menu li").mouseenter(function(e) { e.preventDefault(); $(this).children("ul").stop().slideDown(); });

//Close the submenu $("#tn-menu li").mouseleave(function(e) { e.preventDefault(); $(this).children("ul").stop().slideUp(); });

});