一个基于jquery的Lightbox插件fantybox

一个基于jquery的Lightbox插件fantybox

支持向放大的图像添加阴影,并向一组相关图像添加导航按钮。fanybox是一个华丽的jquery弹出显示插件。该灯箱可以显示图像以及iframed内容,并使用css自定义外观。

一个基于jquery的Lightbox插件fantybox

官方网站:http://www.fancybox.net/home

 

下载地址:https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/fancybox/jquery.fancybox-1.3.4.zip

 

使用示例:

 

1、引入Jquery文件

 

<script type=”text/javascript” src=”http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js”></script>

<script type=”text/javascript” src=”/fancybox/jquery.fancybox-1.3.4.pack.js”></script>

 

2、引入Fancybox样式文件

 

<link rel=”stylesheet” href=”/fancybox/jquery.fancybox-1.3.4.css” rel=”external nofollow” type=”text/css” media=”screen” />

 

3、在需要使用Fancybox的图片中加上属性

 

<a class=”grouped_elements” rel=”group1″ href=”image_big_1.jpg” rel=”external nofollow” ><img src=”image_small_1.jpg” alt=””/></a>

<a class=”grouped_elements” rel=”group1″ href=”image_big_2.jpg” rel=”external nofollow” ><img src=”image_small_2.jpg” alt=””/></a>

 

<a class=”grouped_elements” rel=”group2″ href=”image_big_3.jpg” rel=”external nofollow” ><img src=”image_small_3.jpg” alt=””/></a>

<a class=”grouped_elements” rel=”group2″ href=”image_big_4.jpg” rel=”external nofollow” ><img src=”image_small_4.jpg” alt=””/></a>

 

4、JS文件控制:

 

<script type=”text/javascript”>

jQuery(document).ready(function ($) {

$(“a[rel=group1]”).fancybox({

‘titleShow’: true,

‘transitionIn’: ‘none’,

‘showNavArrows’: true,

‘transitionOut’: ‘none’

});

})

</script>

文章来源网络,作者:运维,如若转载,请注明出处:https://shuyeidc.com/wp/115292.html<

(0)
运维的头像运维
上一篇2025-02-18 01:34
下一篇 2025-02-18 01:36

相关推荐

发表回复

您的邮箱地址不会被公开。必填项已用 * 标注