mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
Skipping visibility:hidden and display:none elements
This commit is contained in:
@ -10,8 +10,8 @@ function html2canvas(el, userOptions) {
|
||||
|
||||
this.opts = this.extendObj(options, {
|
||||
logging: false,
|
||||
ready: function (canvas) {
|
||||
document.body.appendChild(canvas);
|
||||
ready: function (stack) {
|
||||
document.body.appendChild(stack.canvas);
|
||||
},
|
||||
iframeDefault: "default",
|
||||
flashCanvasPath: "http://html2canvas.hertzen.com/external/flashcanvas/flashcanvas.js",
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
|
||||
html2canvas.prototype.newElement = function(el,parentStack){
|
||||
|
||||
|
||||
var bounds = this.getBounds(el);
|
||||
|
||||
var x = bounds.left;
|
||||
|
@ -2,10 +2,10 @@
|
||||
|
||||
html2canvas.prototype.parseElement = function(element,ctx){
|
||||
var _ = this;
|
||||
this.each(element.children,function(index,el){
|
||||
this.each(element.children,function(index,el){
|
||||
_.parsing(el,{
|
||||
ctx:ctx
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
this.canvasRenderer(this.contextStacks);
|
||||
@ -15,10 +15,12 @@ html2canvas.prototype.parseElement = function(element,ctx){
|
||||
|
||||
|
||||
html2canvas.prototype.parsing = function(el,stack){
|
||||
|
||||
if (this.getCSS(el,'display') != "none" && this.getCSS(el,'visibility')!="hidden"){
|
||||
|
||||
var _ = this;
|
||||
|
||||
var _ = this;
|
||||
|
||||
//if (!this.blockElements.test(el.nodeName)){
|
||||
//if (!this.blockElements.test(el.nodeName)){
|
||||
|
||||
stack = this.newElement(el,stack) || stack;
|
||||
|
||||
@ -61,7 +63,7 @@ html2canvas.prototype.parsing = function(el,stack){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// }
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
Reference in New Issue
Block a user