Add ignoreElements predicate function option

This commit is contained in:
Niklas von Hertzen
2018-02-15 21:22:51 +08:00
parent e6c44afca1
commit fad4f837c9
5 changed files with 16 additions and 7 deletions

View File

@ -4,7 +4,9 @@
<title>element render test</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script>
h2cOptions = {ignoreElements: function(element) {
return element.className === 'ignored';
}};
</script>
<script type="text/javascript" src="../../test.js"></script>
<style>
@ -15,7 +17,7 @@
background: green;
}
#ignored {
#ignored, .ignored {
background: red;
width: 100px;
height: 100px;
@ -32,10 +34,11 @@
<div id="ignored" data-html2canvas-ignore>
great failure
</div>
<div class="ignored">
ignore predicate
</div>
<div id="div1">
great success
</div>
</body>
</html>