fixed menu hoover issue 1036, thanks Paolo

This commit is contained in:
mdipierro
2012-09-27 22:28:59 -05:00
parent 6fff0f5eee
commit 2c156e850a
2 changed files with 14 additions and 9 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.0.9 (2012-09-27 22:15:52) stable
Version 2.0.9 (2012-09-27 22:28:55) stable
@@ -8,15 +8,20 @@ jQuery(function(){
if(jQuery(this).find('ul').length)
jQuery(this).addClass('dropdown-submenu');
});
if(jQuery(document).width()>=980) {
jQuery('ul.nav a.dropdown-toggle').parent().hover(function() {
mi = jQuery(this).addClass('open');
mi.children('.dropdown-menu').stop(true, true).delay(200).fadeIn(400);
}, function() {
mi = jQuery(this);
mi.children('.dropdown-menu').stop(true, true).delay(200).fadeOut(function(){mi.removeClass('open')});
});
function hoverMenu(){
var wid = document.documentElement.clientWidth; //faster than $(window).width() and cross browser
if (wid>=980){
jQuery('ul.nav a.dropdown-toggle').parent().hover(function(){
mi = jQuery(this).addClass('open');
mi.children('.dropdown-menu').stop(true, true).delay(200).fadeIn(400);
}, function(){
mi = jQuery(this);
mi.children('.dropdown-menu').stop(true, true).delay(200).fadeOut(function(){mi.removeClass('open')});
});
};
}
hoverMenu(); // first page load
jQuery(window).resize(hoverMenu); // on resize event
jQuery('ul.nav li.dropdown a').click(function(){window.location=jQuery(this).attr('href');});
// make all buttons bootstrap buttons
jQuery('button, form input[type="submit"], form input[type="button"]').addClass('btn');