使用 jquery 灯箱打开 html
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3166225/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
opening html using jquery lightbox
提问by Lalchand
how to open html page using j-query light box .
如何使用 j-query 灯箱打开 html 页面。
回答by Rob Stevenson-Leggett
I'd recommend colorbox. It's the best IMO http://colorpowered.com/colorbox/
我会推荐colorbox。这是最好的 IMO http://colorpowered.com/colorbox/
For implementation just use jquery to attach colorbox to a link or other element's click event
对于实现,只需使用 jquery 将颜色框附加到链接或其他元素的点击事件
e.g.
例如
$('#yourlink').colorbox();
Make sure the HREF of your link is set to the page you want to open e.g.
确保您的链接的 HREF 设置为您要打开的页面,例如
<a href="yourhtml.html" id="yourlink">Open Lightbox</a>
Update 26/11/2011:
2011 年 11 月 26 日更新:
I'm now using Fancyboxinstead. It's got a lot of powerful configuration options and works just as well as colorbox.
我现在使用的是Fancybox。它有很多强大的配置选项,并且与 colorbox 一样好用。
回答by onurbaysan
Here is a script you want.
这是你想要的脚本。
You can download it from
你可以从
http://jquery.com/demo/grey/greybox.tar
http://jquery.com/demo/grey/greybox.tar
Also these are others
还有这些是其他的
http://www.enthropia.com/labs/ibox/
http://www.enthropia.com/labs/ibox/
http://jquery.com/demo/thickbox/
http://jquery.com/demo/thickbox/
回答by Warren Krewenki
If you want to open anything other than images with jquery-lightbox (http://www.github.com/krewenki/jquery-lightbox), you can't. I'll second the recommendation for colorbox.
如果你想用 jquery-lightbox ( http://www.github.com/krewenki/jquery-lightbox)打开图像以外的任何东西,你不能。我将推荐 colorbox。