简体   繁体   English

带孔的模态背景

[英]Modal backdrop with a hole

I am trying to figure out a way in which I can create a transparent modal backdrop but show some parts off the background in a round radius. 我试图找出一种方法,我可以创建一个透明的模态背景,但在圆形半径的背景下显示一些部分。 Something like this. 像这样的东西。 在此输入图像描述

My mind says it can be possible with Canvas tag. 我的想法说Canvas标签可以实现。 Any suggestions are welcome. 欢迎任何建议。 Thanks in advance. 提前致谢。

You could do it with multiple elements, using an SVG or image for the hole. 您可以使用多个元素,使用SVG或图像作为孔。 Only the corners of the image would be filled in. 只会填充图像的角落。

在此输入图像描述

Or you could make a big SVG that would extend far beyond the edges of the window. 或者你可以制作一个远远超出窗口边缘的大型SVG。 Browsers probably clip the rendered area to the window, so it might not perform too badly. 浏览器可能会将渲染区域剪切到窗口,因此它可能执行得不是很糟糕。

Are you looking for masks? 你在找面具吗? http://www.html5rocks.com/en/tutorials/masking/adobe/ http://www.html5rocks.com/en/tutorials/masking/adobe/

Browser support doesn't look to be great 浏览器支持看起来不是很好

I bet the enjoyhint jQuery plugin is exactly what you are looking for. 我敢打赌, enjoyhint jQuery插件正是你想要的。

They have a demo here , the third step in is a circle like: 他们在这里有一个演示 ,第三步是一个像:

在此输入图像描述

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

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