mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
Keep scroll position when toggling canvas view
This commit is contained in:
parent
7cc2b856cb
commit
213f35f61c
@ -39,10 +39,12 @@ var h2cSelector, h2cOptions;
|
||||
if (window.location.search !== "?selenium") {
|
||||
$canvas.siblings().toggle();
|
||||
$(window).click(function(){
|
||||
var scrollTop = $(window).scrollTop();
|
||||
$canvas.toggle().siblings().toggle();
|
||||
$(document.documentElement).css('background', $canvas.is(':visible') ? "none" : "");
|
||||
$(document.body).css('background', $canvas.is(':visible') ? "none" : "");
|
||||
throwMessage("Canvas Render " + ($canvas.is(':visible') ? "visible" : "hidden"));
|
||||
$(window).scrollTop(scrollTop);
|
||||
});
|
||||
$(document.documentElement).css('background', $canvas.is(':visible') ? "none" : "");
|
||||
$(document.body).css('background', $canvas.is(':visible') ? "none" : "");
|
||||
|
Loading…
Reference in New Issue
Block a user