修改jQuery.treeview.js文件中的applyClasses方法(注释掉两行代码):
修改后的applyClasses方法如下:
applyClasses: function(settings, toggler) {
this.filter(":has(>ul):not(:has(>a))").find(">span").click(function(event) {
//注释这行就行了
//toggler.apply($(this).next());}).add( $("a", this) ).hoverClass();
if (!settings.prerendered) {
// handle closed ones first
this.filter(":has(>ul:hidden)")
.addClass(CLASSES.expandable)
.replaceClass(CLASSES.last, CLASSES.lastExpandable);

本文介绍如何通过注释jQuery.treeview.js中的特定代码行来调整treeview行为。具体操作为修改applyClasses方法,以实现点击span元素时不触发toggler应用。
1916

被折叠的 条评论
为什么被折叠?



