【问题标题】:html2Canvas background Stretched Chromehtml2Canvas 背景 拉伸 Chrome
【发布时间】:2015-01-27 04:30:44
【问题描述】:

我正在使用 html2canvas 生成带有背景的画布图像,它在 firefox 上工作得很好,但在 chrome 中,背景是垂直拉伸的,我不确定它有什么问题。

这是我的小提琴链接

http://jsfiddle.net/vnL0jLmc/

代码

html2canvas(document.getElementById('DBackgroundContainer'), {
            allowTaint: true,
            taintTest: false,
            onrendered: function(canvas) {
              document.body.appendChild(canvas);
            }
        })

【问题讨论】:

标签: javascript html canvas html2canvas


【解决方案1】:

问题是这样的:

background-size: 547px auto;

由于某些原因,在 chrome 中,html2canvas 不喜欢“547px auto”(或者单独使用“547px”)。声明两个背景大小部分,您会看到它有效。

我现在正在提交一个错误报告,希望它得到修复,但现在你可以让它再次工作。

【讨论】:

猜你喜欢
  • 2014-06-12
  • 2013-10-03
  • 2011-11-12
  • 2017-01-18
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多