Javascript 从文本链接打开颜色框
[经编辑的问题] 我使用的是一个图像预览工具提示,它利用了rel属性,因此对于colorbox,我使用class=“slideshow”将图像分组在一起。我有这个工作很好,但我想能够从一个文本链接打开幻灯片,如下所示 (rel=“medium.jpg”是用于图像预览的图像)Javascript 从文本链接打开颜色框,javascript,jquery,flickr,colorbox,Javascript,Jquery,Flickr,Colorbox,[经编辑的问题] 我使用的是一个图像预览工具提示,它利用了rel属性,因此对于colorbox,我使用class=“slideshow”将图像分组在一起。我有这个工作很好,但我想能够从一个文本链接打开幻灯片,如下所示 (rel=“medium.jpg”是用于图像预览的图像) 下面是触发颜色框的标准代码,我如何修改它以打开幻灯片 <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js">
下面是触发颜色框的标准代码,我如何修改它以打开幻灯片
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script src="../colorbox/jquery.colorbox.js"></script>
<script>
$(document).ready(function(){
$("a.openSlideshow").colorbox({slideshow:true});
});
</script>
$(文档).ready(函数(){
$(“a.openSlideshow”).colorbox({slideshow:true});
});
提前谢谢。我看了彩盒页面,所有内容都在这里解释
看看这个,这正是您想要做的:我看了colorbox页面,这里解释了所有内容
看看这个,这正是你想要做的:在动态创建库之后扩展它
$(document).ready(function() {
//dynamacially create the gallery here
$("a.slideshow").colorbox({ slideshow: true });
})
只需在动态创建库之后扩展它
$(document).ready(function() {
//dynamacially create the gallery here
$("a.slideshow").colorbox({ slideshow: true });
})
嗯,当我尝试Kai的建议时,它不起作用 使用示例页面:
$(document).ready(function(){
//Examples of how to assign the ColorBox event to elements
$("a.example4").colorbox({ slideshow: true });
<h2>Slideshow</h2>
<p><a href="../content/ohoopee1.jpg" class="example4" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p>
<p><a href="../content/ohoopee2.jpg" class="example4" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
<p><a href="../content/ohoopee3.jpg" class="example4" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
$(文档).ready(函数(){
//如何将ColorBox事件指定给元素的示例
$(“a.example4”).colorbox({slideshow:true});
幻灯片
嗯,当我尝试Kai的建议时,它不起作用
使用示例页面:
$(document).ready(function(){
//Examples of how to assign the ColorBox event to elements
$("a.example4").colorbox({ slideshow: true });
<h2>Slideshow</h2>
<p><a href="../content/ohoopee1.jpg" class="example4" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p>
<p><a href="../content/ohoopee2.jpg" class="example4" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
<p><a href="../content/ohoopee3.jpg" class="example4" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
$(文档).ready(函数(){
//如何将ColorBox事件指定给元素的示例
$(“a.example4”).colorbox({slideshow:true});
幻灯片
我想你错过了ID-见下面我的答案我想你错过了ID-见下面我的答案我忘了提到,我没有使用rel,我使用的是class=“”将images.DOH.a.slideshow作为类选择器进行分组…那么你是否尝试了Kai的建议?在我更改示例页面时对我有效-查看我的修改答案我忘了提到,我没有使用rel,我使用的是class=“”将images.DOH.a.slideshow作为类选择器进行分组…那么您是否尝试了Kai的建议?在我更改示例页面时对我有效-请参阅我修改的答案