jQuery 灯箱没有图像只有文字?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9618686/
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-27 11:04:18  来源:igfitidea点击:

lightbox no image just text?

jquerylightbox

提问by Beginner

I am currently using light box provided by ... http://leandrovieira.com/projects/jquery/lightbox/

我目前正在使用... http://leandrovieira.com/projects/jquery/lightbox/提供的灯箱

How do I have it so that if I click on a work it brings up the light box and shows text instead of an image? what I want is the terms and conditions shown up in a lightbox.

我如何拥有它,以便当我点击一件作品时,它会显示灯箱并显示文本而不是图像?我想要的是灯箱中显示的条款和条件。

HTML

HTML

<span id="terms"> <a href="">Terms & Conditions</a></span>

jQuery

jQuery

$(function () {
   $('#terms a').lightBox();
});

采纳答案by Kres

It seems like this lightbox plugin only works with images. You should choose another plugin like colorbox: http://Hymanlmoore.com/colorbox/It's simple to use and supports iframes and also div elements inside the lightbox.

这个灯箱插件似乎只适用于图像。您应该选择另一个插件,如 colorbox:http://Hymanlmoore.com/colorbox/ 它使用简单,支持 iframe 以及灯箱内的 div 元素。

回答by Nicola Peluchetti

I don't think that you can use the plugin as you desire,because that plugin works with images, in any case specify the text you want to appear in the title of the <a>

我不认为您可以随心所欲地使用该插件,因为该插件适用于图像,无论如何请指定要出现在标题中的文本 <a>

 <a title="this plugin takes text from here" href="">Terms & Conditions</a>

But i think you will have to find another plugin

但我认为你必须找到另一个插件

回答by MattP

I like to use Fancybox to show content in a lightbox. Create a simple HTML page for your terms and conditions then the page will load within the lightbox. If Javascript is disabled they will be taken to the page via the link

我喜欢使用 Fancybox 在灯箱中显示内容。为您的条款和条件创建一个简单的 HTML 页面,然后该页面将在灯箱中加载。如果 Javascript 被禁用,它们将通过链接被带到页面

http://fancybox.net/

http://fancybox.net/