放大d3js中的异物

时间:2015-09-07 10:48:49

标签: javascript d3.js svg

如何缩放异物?

代码:

 var menu = svgContainer.append('foreignObject').attr('width', 480).attr('height', 500);


var result = d3.select('foreignObject').html('<div id="divDT1" class="dataModelTable selected"><div class="dataTableName"> Skill </div><div class="widget"><div class="widget-head"> <a href="#" id="toggle1" class="fa fa-chevron-up fa-1x attributes"><i></i></a> Attributes </div><div class="widget-body attributesBody" id="widget-body1" style="display: block;"><ul><li class="columnsList">SkillDisplayName </li><li class="columnsList">skillName </li><li class="columnsList">idSkill </li><li class="columnsList">skillDesxription </li></ul></div></div></div>')
            .call(d3.behavior.zoom().on("zoom", function () 
           {
             result.attr("transform", "translate(" + d3.event.translate + ")" + " scale(" + d3.event.scale + ")")
           }));

尝试使用缩放功能但不能正常工作

0 个答案:

没有答案