延迟执行展开zTree树

	//延迟执行展开树
	function expanLessonTree(){
	  	var zTree = $.fn.zTree.getZTreeObj("lessonTree");
	  	var nodes = zTree.getNodes();
	  	if(nodes!=null){
		  	var treeNode=nodes[0];
		  	zTree.expandNode(treeNode);
	  	}
	}
	


$(document).ready(function() {
	$(window).load(function() {
	  		setTimeout(expanLessonTree, 1000);
     	});
});

你可能感兴趣的:(JavaScript,ztree)