JS 弹出元素使周围站点变暗
我不太确定如何描述我想做的事情,但我确信我以前在很多网站上见过它。
基本上,当有人单击链接时,它应该显示一个包含一些文本的元素,并调暗网站的其余部分,以便用户的焦点指向该元素。它也不应该让用户单击灰色区域,因为通知需要确认才能发送。
我在我的网站上使用 jQuery,所以如果它更容易的话我很乐意使用它。
I'm not really sure how to describe what I want to do, but I'm sure I've seen it on many sites before.
Basically, when someone clicks a link, it should show an element which contains some text and dims down the rest of the site so that the users focus is directed towards the element. It shouldn't let users click in the dimmed area either, because the notification needs confirmation before it will go.
I'm using jQuery on my site, so I'm happy to use that if it'd be easier.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
jQuery UI 的 dialog 小部件在“模态”模式下打开时将使用“半透明”背景。
html:
javascript:
演示此处
jQuery UI's dialog widget will use a 'semi-transparent' background when opened in 'modal' mode.
html:
javascript:
Demo here
添加额外的 div 来覆盖内容。遮罩应放置在除要弹出的控件之外的所有元素的顶部。使用下面的jquery代码,可以实现这个功能。假设新添加的控件(div)的 id='mask'
add an extra div to cover the content. The mask should be placed on top of all elements except the control that is to be popped up. Using the jquery code below, this functionality can be achieved. Assuming the newly added control(div) is having id='mask'
看看这个 jQuery 插件,它完全符合您的要求:)
http://dev7studios。 com/demo/jquery-spotlight/
这很好。
Take a look at this plugin for jQuery, it does exactly what you want :)
http://dev7studios.com/demo/jquery-spotlight/
Which is nice.
我相信你想使用 colorbox 来实现它。 (灯箱)。
http://colorpowered.com/colorbox/core/example1/index.html
或者您可以尝试 Boxy Lightbox 插件。
http://onehackoranother.com/projects/jquery/boxy/
I believe you want to use colorbox for it. (Lightbox).
http://colorpowered.com/colorbox/core/example1/index.html
or you can try Boxy Lightbox plugin.
http://onehackoranother.com/projects/jquery/boxy/
我个人最喜欢的是 shadowbox.js
My personal favorite is shadowbox.js
它通常被称为“灯箱”。我使用一个名为 nyroModal 的插件,它非常灵活并且具有广泛的浏览器支持。
It's often called a "lightbox". I use a plugin called nyroModal which is really flexible and has wide browser support.
我也会继续在这件事上投入我的两分钱。我选择的 jQuery 模态插件是 jqModal。也值得一看
http://dev.iceburg.net/jquery/jqModal/
I'll go ahead and throw my two cents in on this one as well. My jQuery modal plugin of choice is jqModal. Worth checking out as well
http://dev.iceburg.net/jquery/jqModal/