Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在firefox/chrome/IE中滚动SVG_Svg - Fatal编程技术网

在firefox/chrome/IE中滚动SVG

在firefox/chrome/IE中滚动SVG,svg,Svg,我有一个用SVG建模的相当大的树形图 在IE-9中,它的渲染效果很好,可以根据需要进行垂直滚动 在Chrome和Firefox中,情况并非如此。在Chrome中没有滚动,但缩小可以让我看到更多。 在Firefox中,它只显示垂直空间的标记量 我假设我在“svg”元素中缺少一些属性,以使其在Chrome/Firefox中正确显示,但不确定是什么 以下是文档源的启动方式: <!DOCTYPE html> <html> <body> <svg xmlns="

我有一个用SVG建模的相当大的树形图

在IE-9中,它的渲染效果很好,可以根据需要进行垂直滚动

在Chrome和Firefox中,情况并非如此。在Chrome中没有滚动,但缩小可以让我看到更多。 在Firefox中,它只显示垂直空间的标记量

我假设我在“svg”元素中缺少一些属性,以使其在Chrome/Firefox中正确显示,但不确定是什么

以下是文档源的启动方式:

<!DOCTYPE html>
<html>
<body>

<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="100%" width="100%" style="overflow-x: auto; overflow-y: auto;"  >

  <rect x="685" y="15" rx="10" ry="10" width="380" height="116" style="fill:lightgrey;stroke-width:5;stroke:rgb(0,0,0)" />
  <text x="777" y="38" fill="black"  font-size = "18"  font-family = "sans-serif" font-weight="bold">Folder</text>
  <text x="960" y="38" fill="black"  font-size = "18"  font-family = "sans-serif" font-weight="bold">Content</text>

  <rect x="700" y="45" rx="10" ry="10" width="200" height="75" style="fill:powderblue;stroke-width:1;stroke:rgb(0,0,0)" />
  ................... and so on for 150000 lines ...................

文件夹
内容
................... 15万条线路如此等等。。。。。。。。。。。。。。。。。。。
关于可以添加哪些内容以便在Chrome/Firefox中像在IE-9中一样呈现,您有什么想法吗?

将值硬编码为“高度”和“宽度”解决了Chrome和Firefox中无法滚动的严重问题

使生成svg的脚本更智能,以便为“高度”和“宽度”输入适当的值是一个更好的解决方案,但现在只需设置
height=“50000”width=“2400”

它没有使用%值,而是为我工作。

Firefox目前不支持外部元素溢出。看见