Template:Team:Amsterdam/ernst/scripts

From 2012.igem.org

(Difference between revisions)
Line 52: Line 52:
}
}
-
function submenu3(){
+
function submenu3() {
 +
$(" #submenu ul ul ").css({display: "none", height:'auto'}); // Opera Fix
-
$(" #submenu ul ul ").css({display: "none", height:'auto'}); // Opera Fix
+
var timer;
-
 
+
$(" #submenu ul li ").hover(function() {
-
var delaytimer
+
if(timer) {
-
$(" #submenu ul li").hover(function(){
+
clearTimeout(timer);
-
if(delaytimer) {
+
timer = null;
-
clearTimeout(delaytimer);
+
-
delaytimer = null;
+
}
}
-
delaytimer = setTimeout(function() {
+
timer = setTimeout(function() {
-
$(this).find('ul:first').animate({display:'block', height:'show'},{queue:true, duration:400});
+
$(this).find('ul:first').animate({display:'block', height:'show'},{queue:true, duration:400});
-
}},function(){
+
}, 500);
-
$(this).find('ul:first').animate({height:'hide', display:'none'},{queue:true, duration:400});
+
    },function(){
-
},500));
+
$(this).find('ul:first').animate({height:'hide', display:'none'},{queue:true, duration:400});
-
}
+
});
 +
};
   
   
$(document).ready(function(){
$(document).ready(function(){
//submenu();
//submenu();
-
submenu2();
+
//submenu2();
-
//submenu3();
+
submenu3();
});
});

Revision as of 10:39, 11 September 2012