javascript 如何使用 ColorBox jQuery 插件显示 HTML 页面
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6223972/
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
How to display an HTML page with the ColorBox jQuery plugin
回答by rahul
If you want to open an outside HTML here is the sample
如果您想打开外部 HTML,这里是示例
http://colorpowered.com/colorbox/core/example1/index.html
http://colorpowered.com/colorbox/core/example1/index.html
Code would be something like
代码将类似于
HTML
HTML
<a class='example5' href="yourpage.html" title="My Page">Outside HTML (Ajax)</a>
jQuery
jQuery
$(".example5").colorbox();
回答by Misam
Just refer the jQuery plugin in your HTML page using
只需使用在 HTML 页面中引用 jQuery 插件
<script type="text/javascript" src="/path of jQuery library"></script>
<script type="text/javascript" src="/path of color box"></script>
回答by Teneff
like this:
像这样:
<a class="example5 cboxElement" href="../content/ajax.html" title="Homer Defined">
Outside HTML (Ajax)
</a>
js:
js:
$(".example5").colorbox();
just look at their example page
看看他们的示例页面