\").length;a++){ 13 whichobj(firststr.split(\">\")[a].split(\"(\")[0]); 14 if(a%5==4){15 var avgwidth=(parseFloat($(\"#right-area\").width())-objsumwidth)/5.0; 16 //判断⽅向是从左往右还是从右往左的⽅向 17 if(a%10==4){//从左往右画对象 18 for(var b=a-4;b<=a;b++){ 19 if(b==a-4){
20 shapeobjjson.shapeobj[b].offsettop = a*35;
21 shapeobjjson.shapeobj[b].offsetleft = avgwidth/2.0+$(\".navbox\").width();
22 shapeobjjson.shapeobj[b].leftcenterdot = avgwidth/2.0+$(\".navbox\").width()+\";\"+(parseFloat(a*35)+parseFloat(shapeobjjson.shapeobj[b].height/2));
23 shapeobjjson.shapeobj[b].rightcenterdot = (parseFloat(avgwidth/2.0+$(\".navbox\").width())+parseFloat(shapeobjjson.shapeobj[b].width))+\";\"+(parseFloat(a*35)+parseFloat(shapeobjjson.shapeobj[b].height/2)); 24 shapeobjjson.shapeobj[b].topcenterdot = (parseFloat(avgwidth/2.0+$(\".navbox\").width())+parseFloat(shapeobjjson.shapeobj[b].width/2))+\";\"+parseFloat(a*35);
25 shapeobjjson.shapeobj[b].bottomcenterdot = (parseFloat(avgwidth/2.0+$(\".navbox\").width())+parseFloat(shapeobjjson.shapeobj[b].width/2))+\";\"+(parseFloat(a*35)+parseFloat(shapeobjjson.shapeobj[b].height)); 26 beforewidth=parseFloat(shapeobjjson.shapeobj[b].width)+avgwidth/2.0+$(\".navbox\").width(); 27 beforeheight=a*35;
28 console.log(\"beforewidth:\"+beforewidth+\";\"+\"beforeheight:\"+beforeheight); 29 }else{
30 shapeobjjson.shapeobj[b].offsettop = a*35;
31 shapeobjjson.shapeobj[b].offsetleft = beforewidth+avgwidth;
32 shapeobjjson.shapeobj[b].leftcenterdot = (beforewidth+avgwidth)+\";\"+(parseFloat(a*35)+parseFloat(shapeobjjson.shapeobj[b].height/2));
33 shapeobjjson.shapeobj[b].rightcenterdot = (parseFloat(beforewidth+avgwidth)+parseFloat(shapeobjjson.shapeobj[b].width))+\";\"+(parseFloat(a*35)+parseFloat(shapeobjjson.shapeobj[b].height/2)); 34 shapeobjjson.shapeobj[b].topcenterdot = (parseFloat(beforewidth+avgwidth)+parseFloat(shapeobjjson.shapeobj[b].width/2))+\";\"+parseFloat(a*35);
35 shapeobjjson.shapeobj[b].bottomcenterdot = (parseFloat(beforewidth+avgwidth)+parseFloat(shapeobjjson.shapeobj[b].width/2))+\";\"+(parseFloat(a*35)+parseFloat(shapeobjjson.shapeobj[b].height)); 36 beforewidth=parseFloat(shapeobjjson.shapeobj[b].width)+beforewidth+avgwidth; 37 beforeheight=a*35; 38 } 39 }
40 }else if(a%10==9){//从右往左画对象 41 for(var b=a-4;b<=a;b++){ 42 if(b==a-4){
43 shapeobjjson.shapeobj[b].offsettop = a*35;
44 shapeobjjson.shapeobj[b].offsetleft = $(\"#right-area\").width()-avgwidth/2.0-shapeobjjson.shapeobj[b].width+$(\".navbox\").width();
45 shapeobjjson.shapeobj[b].leftcenterdot = ($(\"#right-area\").width()-avgwidth/2.0-shapeobjjson.shapeobj[b].width+$(\".navbox\").width())+\";\"+(parseFloat(a*35)+parseInt(shapeobjjson.shapeobj[b].height/2));
46 shapeobjjson.shapeobj[b].rightcenterdot = (parseFloat($(\"#right-area\").width()-avgwidth/2.0-shapeobjjson.shapeobj[b].width+$(\".navbox\").width())+parseFloat(shapeobjjson.shapeobj[b].width))+\";\"+(parseFloat(a*35)+parseFloa 47 shapeobjjson.shapeobj[b].topcenterdot = (parseFloat($(\"#right-area\").width()-avgwidth/2.0-shapeobjjson.shapeobj[b].width+$(\".navbox\").width())+parseFloat(shapeobjjson.shapeobj[b].width/2))+\";\"+(a*35);
48 shapeobjjson.shapeobj[b].bottomcenterdot = (parseFloat($(\"#right-area\").width()-avgwidth/2.0-shapeobjjson.shapeobj[b].width+$(\".navbox\").width())+parseFloat(shapeobjjson.shapeobj[b].width/2))+\";\"+(parseFloat(a*35)+ 49 beforewidth=$(\"#right-area\").width()-avgwidth/2.0-parseFloat(shapeobjjson.shapeobj[b].width)+$(\".navbox\").width(); 50 beforeheight=a*35; 51 }else{
52 shapeobjjson.shapeobj[b].offsettop = a*35;
53 shapeobjjson.shapeobj[b].offsetleft = beforewidth-avgwidth-shapeobjjson.shapeobj[b].width;
54 shapeobjjson.shapeobj[b].leftcenterdot = (beforewidth-avgwidth-shapeobjjson.shapeobj[b].width)+\";\"+(parseFloat(a*35)+parseFloat(shapeobjjson.shapeobj[b].height/2));
55 shapeobjjson.shapeobj[b].rightcenterdot = (parseFloat(beforewidth-avgwidth-shapeobjjson.shapeobj[b].width)+parseFloat(shapeobjjson.shapeobj[b].width))+\";\"+(parseFloat(a*35)+parseFloat(shapeobjjson.shapeobj[b].height/2 56 shapeobjjson.shapeobj[b].topcenterdot = (parseFloat(beforewidth-avgwidth-shapeobjjson.shapeobj[b].width)+parseFloat(shapeobjjson.shapeobj[b].width/2))+\";\"+(a*35);
57 shapeobjjson.shapeobj[b].bottomcenterdot = (parseFloat(beforewidth-avgwidth-shapeobjjson.shapeobj[b].width)+parseFloat(shapeobjjson.shapeobj[b].width/2))+\";\"+(parseFloat(a*35)+parseFloat(shapeobjjson.shapeobj[b].he 58 beforewidth=beforewidth-avgwidth-parseFloat(shapeobjjson.shapeobj[b].width); 59 beforeheight=a*35; 60 } 61 } 62 }
63 //图形转到下⼀⾏的时候,宽度重新赋值为0,⾼度值继续累加 beforewidth=0; 65 objsumwidth=0;
66 }else if(a==firststr.split(\">\").length-1){
67 var avgwidth=(parseFloat($(\"#right-area\").width())-objsumwidth)/parseFloat(firststr.split(\">\").length%5); 68 for(var b=a-parseFloat(firststr.split(\">\").length%5)+1;b<=a;b++){ 69 console.log(b);
70 if((parseInt(b/5)+1)%2==1){//从左往右画对象
71 if(b==firststr.split(\">\").length-firststr.split(\">\").length%5){ 72 shapeobjjson.shapeobj[b].offsettop = beforeheight+140;
73 shapeobjjson.shapeobj[b].offsetleft = avgwidth/2.0+$(\".navbox\").width();
74 shapeobjjson.shapeobj[b].leftcenterdot = avgwidth/2.0+$(\".navbox\").width()+\";\"+(parseFloat(beforeheight+140)+parseFloat(shapeobjjson.shapeobj[b].height/2));
75 shapeobjjson.shapeobj[b].rightcenterdot = (parseFloat(avgwidth/2.0+$(\".navbox\").width())+parseFloat(shapeobjjson.shapeobj[b].width))+\";\"+(parseFloat(beforeheight+140)+parseFloat(shapeobjjson.shapeobj[b].height/2 76 shapeobjjson.shapeobj[b].topcenterdot = (parseFloat(avgwidth/2.0+$(\".navbox\").width())+parseFloat(shapeobjjson.shapeobj[b].width/2))+\";\"+parseFloat(beforeheight+140);
77 shapeobjjson.shapeobj[b].bottomcenterdot = (parseFloat(avgwidth/2.0+$(\".navbox\").width())+parseFloat(shapeobjjson.shapeobj[b].width/2))+\";\"+(parseFloat(beforeheight+140)+parseFloat(shapeobjjson.shapeobj[b].height)); 78 beforewidth=parseFloat(shapeobjjson.shapeobj[b].width)+avgwidth/2.0+$(\".navbox\").width(); 79 beforeheight=beforeheight+140;
80 console.log(\"beforewidth:\"+beforewidth+\";\"+\"beforeheight:\"+beforeheight); 81 }else{
82 shapeobjjson.shapeobj[b].offsettop = beforeheight;
83 shapeobjjson.shapeobj[b].offsetleft = beforewidth+avgwidth;
84 shapeobjjson.shapeobj[b].leftcenterdot = (beforewidth+avgwidth)+\";\"+(parseFloat(beforeheight)+parseFloat(shapeobjjson.shapeobj[b].height/2));
85 shapeobjjson.shapeobj[b].rightcenterdot = (parseFloat(beforewidth+avgwidth)+parseFloat(shapeobjjson.shapeobj[b].width))+\";\"+(parseFloat(beforeheight)+parseFloat(shapeobjjson.shapeobj[b].height/2)); 86 shapeobjjson.shapeobj[b].topcenterdot = (parseFloat(beforewidth+avgwidth)+parseFloat(shapeobjjson.shapeobj[b].width/2))+\";\"+parseFloat(beforeheight);
87 shapeobjjson.shapeobj[b].bottomcenterdot = (parseFloat(beforewidth+avgwidth)+parseFloat(shapeobjjson.shapeobj[b].width/2))+\";\"+(parseFloat(beforeheight)+parseFloat(shapeobjjson.shapeobj[b].height)); 88 beforewidth=parseFloat(shapeobjjson.shapeobj[b].width)+beforewidth+avgwidth;
// beforeheight=beforeheight+140; 90 }
91 }else if((parseInt(b/5)+1)%2==0){//从右往左画对象
92 if(b==firststr.split(\">\").length-firststr.split(\">\").length%5){ 93 shapeobjjson.shapeobj[b].offsettop = beforeheight+140;
94 shapeobjjson.shapeobj[b].offsetleft = $(\"#right-area\").width()-avgwidth/2.0-shapeobjjson.shapeobj[b].width;
95 shapeobjjson.shapeobj[b].leftcenterdot = ($(\"#right-area\").width()-avgwidth/2.0-shapeobjjson.shapeobj[b].width)+\";\"+(parseFloat(beforeheight+140)+parseFloat(shapeobjjson.shapeobj[a].height/2));
96 shapeobjjson.shapeobj[b].rightcenterdot = (parseFloat($(\"#right-area\").width()-avgwidth/2.0-shapeobjjson.shapeobj[b].width)+parseFloat(shapeobjjson.shapeobj[b].width))+\";\"+(parseFloat(beforeheight+140)+parseFloat(shape 97 shapeobjjson.shapeobj[b].topcenterdot = (parseFloat($(\"#right-area\").width()-avgwidth/2.0-shapeobjjson.shapeobj[b].width)+parseFloat(shapeobjjson.shapeobj[b].width/2))+\";\"+(beforeheight+140);
98 shapeobjjson.shapeobj[b].bottomcenterdot = (parseFloat($(\"#right-area\").width()-avgwidth/2.0-shapeobjjson.shapeobj[b].width)+parseFloat(shapeobjjson.shapeobj[b].width/2))+\";\"+(parseFloat(beforeheight+140)+ 99 beforewidth=$(\"#right-area\").width()-avgwidth/2.0-parseFloat(shapeobjjson.shapeobj[b].width);100 beforeheight=beforeheight+140;101 }else{
102 shapeobjjson.shapeobj[b].offsettop = beforeheight;
103 shapeobjjson.shapeobj[b].offsetleft = beforewidth-avgwidth-shapeobjjson.shapeobj[b].width;
104 shapeobjjson.shapeobj[b].leftcenterdot = (beforewidth-avgwidth-shapeobjjson.shapeobj[b].width)+\";\"+(parseFloat(beforeheight)+parseFloat(shapeobjjson.shapeobj[b].height/2));
105 shapeobjjson.shapeobj[b].rightcenterdot = (parseFloat(beforewidth-avgwidth-shapeobjjson.shapeobj[b].width)+parseFloat(shapeobjjson.shapeobj[b].width))+\";\"+(parseFloat(beforeheight)+parseFloat(shapeobjjson.shapeobj[b106 shapeobjjson.shapeobj[b].topcenterdot = (parseFloat(beforewidth-avgwidth-shapeobjjson.shapeobj[b].width)+parseFloat(shapeobjjson.shapeobj[b].width/2))+\";\"+(beforeheight);
107 shapeobjjson.shapeobj[b].bottomcenterdot = (parseFloat(beforewidth-avgwidth-shapeobjjson.shapeobj[b].width)+parseFloat(shapeobjjson.shapeobj[b].width/2))+\";\"+(parseFloat(beforeheight)+parseFloat(shapeobjjson.shapeo108 beforewidth=beforewidth-avgwidth-parseFloat(shapeobjjson.shapeobj[b].width);109 // beforeheight=beforeheight+140;110 }111 }112 }113 }114 }
115 beforewidth=0;116 objsumwidth=0;117 beforeheight=0;
118 console.log(\"shapeobjjson:\"+JSON.stringify(shapeobjjson));119 //加载到页⾯上
120 for(var c=0;c121 $(\".right-area\").html($(\".right-area\").html()+''123 +''124 +''125 +''126 +'
'127 +'
'+firststr.split(\">\")[c].split(\"(\")[1].split(\")\")[0]+'