2014-02-17 59 views

回答

2

嘗試

function jsddm_open(event) { 
    jsddm_canceltimer(); 
    jsddm_close(); 
    var submenu = $(this).find('ul'); 
    if (submenu.length) { 
     ddmenuitem = submenu.css('visibility', 'visible'); 
    } 
    event.stopPropagation(); 
} 

演示:Fiddle

的主要問題是if (submenu) {因爲.find()返回一個jQuery對象,這將永遠是truthy所以你的處理器將假每次都返回防止點擊的默認操作

+0

thanx it worked !!! –