大佬教程收集整理的这篇文章主要介绍了jquery – 同一图库中的Fancybox图像和视频,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
这是我的标记…我有相同的rel属性,所以他们在同一个库中,但我正在调用一个不同的脚本,以便可以正确设置类型.
$("a#brianguehring").fancybox(); $("a#brianguehring-video").fancybox({ 'type' : 'swf','transitionIn' : 'none','transitionOut' : 'none',}); <span> <a class="grouped_elements icon_camera" rel="group-brian" id="brianguehring" title="Brian Guehring Website" href="images/portfolio/brianguehring-one.png"></a> </span> <span> <a class="grouped_elements" rel="group-brian" id="brianguehring-video" title="Pasquale Vitello'Showreel 2010" href="http://vimeo.com/24081323"> </a> </span>
$(document).ready(function(e) { $("a[rel=example_group]").fancybox({ 'transitionIn' : 'none','titlePosition' : 'over','titleFormat' : function(title,currentArray,currentIndex,currentOpts) { return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + ' ' + title + '</span>'; } }); });
您的HTML将如下所示:注意:请注意,Vimeo播放器的href是player.vimeo.com/video/YourIDHere.不需要SWF代码.它只是有效.您还需要将锚点rel =“”作为相同的名称,以便将对象放入同一组中.
<div> <a rel="example_group" title="Custom title" href="http://farm3.static.flickr.com/2641/4163443812_df0b200930.jpg"> <img alt="" src="http://farm3.static.flickr.com/2641/4163443812_df0b200930_m.jpg" /> </a> <a rel="example_group" title="Title of video here" class="varIoUs iframe" href="http://player.vimeo.com/video/24081323?title=0&byline=0&portrait=0"> <img alt="" src="http://farm3.static.flickr.com/2591/4135665747_3091966c91_m.jpg" /> </a></div>
以上是大佬教程为你收集整理的jquery – 同一图库中的Fancybox图像和视频全部内容,希望文章能够帮你解决jquery – 同一图库中的Fancybox图像和视频所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。