使用 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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 14:57:55  来源:igfitidea点击:

opening html using jquery lightbox

jqueryhtml

提问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 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。