Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

watermark_parent_node不管用 #28

Closed
Tianruo opened this issue Aug 20, 2019 · 2 comments
Closed

watermark_parent_node不管用 #28

Tianruo opened this issue Aug 20, 2019 · 2 comments

Comments

@Tianruo
Copy link

Tianruo commented Aug 20, 2019

挂载的父节点属性无作用,结果还是挂载到了body上面

系统:windows
浏览器:chrome
框架:react

@sunweiconfidence
Copy link

我的也是不起作用:
index.js
/初始化水印/
watermark.init({
watermark_txt: "测试,1021002301,测试 10.157.182.139",
watermark_parent_node: "div#test"
});
/加载水印/
watermark.load({
watermark_txt: "测试,1021002301,测试 10.157.182.139",
watermark_parent_node: "div#test"

});
/移除水印/
document.getElementById('remove-watermark').addEventListener("click", function() {
watermark.remove();
}, true)

/添加水印/
document.getElementById('add-watermark').addEventListener("click", function() {
watermark.load({
watermark_txt: "测试,1021002301,测试 10.157.182.139",
watermark_parent_node: "div#test"
});
}, true)

index.html如下:

<title>watermark-simple</title>

测试页面-watermark-simple

移除水印 添加水印

watermark源代码

<script src="../watermark.js"></script> <script src="./index.js"></script>

@saucxs
Copy link
Owner

saucxs commented Nov 11, 2019

该问题已经解决,请更新到2.2.0 版本。
使用例子,比如:
watermark.load({ watermark_parent_node: "watermark-parent", watermark_txt: "saucxs,1021002301,测试水印,100101010111101" });
详细见源码下:/examples/examples-simple文件为一个简单使用例子。 @Tianruo @sunweiconfidence

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants