- 注册时间
- 2012-11-2
- 最后登录
- 2020-7-8
- 阅读权限
- 10
- 积分
- 45
- 精华
- 0
- 帖子
- 5
|
felt 发表于 2020-7-6 17:49
把页面js都包裹在window.onload=function(){}内,确保完全加载完毕后再使用
把demo的index.html中js全包起来好像也不行(极速模式)
<script type="text/javascript">
window.onunload = function () {
mini.parse();
function onBeforeExpand(e) {
var tree = e.sender;
var nowNode = e.node;
var level = tree.getLevel(nowNode);
var root = tree.getRootNode();
tree.cascadeChild(root, function (node) {
if (tree.isExpandedNode(node)) {
var level2 = tree.getLevel(node);
if (node != nowNode && !tree.isAncestor(node, nowNode) && level == level2) {
tree.collapseNode(node, true);
}
}
});
}
}
</script>
|
|