0

I use this script to create a pull down box, works perfectly excepting a single thing. If i add a link in that box, pressing it will result in no action. Shortly the links don't work in this script. Could anyone tell me what's wrong?

Script:

 function prepareList() {
     $('#expList').find('li:has(ul)')
         .click(function (event) {
             if (this == event.target) {
                 $(this).toggleClass('expanded');
                 $(this).children('ul').toggle('medium');
             }
             return false;
         })
         .addClass('collapsed')
         .children('ul').hide();
};
$(document).ready(function () {
    prepareList()
});
4

1 回答 1

1

您的事件处理程序正在捕获对 URL 的点击,并且“return false”正在取消它。

尝试删除错误..不确定您在此实现中是否需要它..

安德鲁

于 2013-08-05T16:05:20.473 回答