简体   繁体   English

使用javascript(或html5!)使html中的正文变暗

[英]Darken body in html using javascript (or html5!)

I would like to know how to be able to "darken" the image of a html page without darkening the area I selected over that same image, just like this example http://odyniec.net/projects/imgareaselect/ . 我想知道如何能够“变暗”一个html页面的图像而不会使我在同一图像上选择的区域变暗,就像这个示例http://odyniec.net/projects/imgareaselect/一样 I studied the code but remained the same. 我研究了代码,但保持不变。 Can someone help me? 有人能帮我吗? Thank you! 谢谢!

EDIT: 编辑:

I was able to darken the body but unfortunately, even playing with opacity, the content inside the div referring to the selection remained faded to. 我能够使身体变暗,但是不幸的是,即使玩了不透明的音色,div内与选择有关的内容仍然褪色。

They are achieving this affect using four different div's to do the darkening. 他们正在使用四个不同的div进行变暗来实现这种效果。 One for everything to the top, right, bottom and left. 一种用于顶部,右侧,底部和左侧的所有内容。 Don't have time to explain further right now, but that is what is happening on the surface level. 现在没有时间进一步解释,但这就是表面上正在发生的事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM