From ed4d5731f69de133c80f509660a91886776c101c Mon Sep 17 00:00:00 2001 From: Sumh <42424861@qq.com> Date: Sat, 4 Feb 2012 16:33:00 +0800 Subject: [PATCH] Don't shift the sibling tree when toggle sub tree Sumh <42424861@qq.com> --- jquery.jOrgChart.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/jquery.jOrgChart.js b/jquery.jOrgChart.js index daec657..bb6c762 100644 --- a/jquery.jOrgChart.js +++ b/jquery.jOrgChart.js @@ -152,14 +152,15 @@ $nodeDiv.click(function() { var $this = $(this); var $tr = $this.closest("tr"); - $tr.nextAll("tr").fadeToggle("fast"); if($tr.hasClass('contracted')){ $this.css('cursor','n-resize'); - $tr.addClass('expanded'); + $tr.removeClass('contracted').addClass('expanded'); + $tr.nextAll("tr").css('visibility', ''); }else{ $this.css('cursor','s-resize'); - $tr.addClass('contracted'); + $tr.removeClass('expanded').addClass('contracted'); + $tr.nextAll("tr").css('visibility', 'hidden'); } });