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

loadMark多次调用时defaultSettings变量的复用问题 #23

Closed
shellphon opened this issue Jun 27, 2019 · 1 comment
Closed

loadMark多次调用时defaultSettings变量的复用问题 #23

shellphon opened this issue Jun 27, 2019 · 1 comment

Comments

@shellphon
Copy link

看了源码,loadMark是水印产生的主要逻辑,resize等事件会多次调用loadMark,而loadMark里对于defaultSettings的使用有点问题,https://github.com/saucxs/watermark-dom/blob/master/watermark.js#L134~L142 当多次调用loadMark时,实际上后一次的计算处理拿到的一些关键值不再是一开始声明的初始化值,这将导致resize触发后,一些变量计算不再准确,甚至出现NaN的情况,demo里也可以发现问题,在页面最大化到变回小窗口时,水印有丢失的情况(计算错误导致)

@saucxs
Copy link
Owner

saucxs commented Aug 16, 2019

谢谢你的支出,问题已经解决,请用最新的代码查看,watermark-dom版本升级到2.1.0。 @shellphon

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

2 participants