PrettyPhoto,一款基于Jquery的图片播放插件的使用
2014-06-12 17:20
976 查看
PrettyPhoto是一款基于jquery的轻量级的lightbox图片浏览插件,它不仅支持图片播放 , 而且还支持视频、flash、YouTuBe、Iframe及ajax。此外,PrettyPhoto在配置、使用或者扩展使用方面都有不错的表现,另外,它兼容了市面上主流浏览器,其中就包括了让web工程师抓狂的IE6。与此之外,它可以实现在查看大图的页面上展示缩略图。正因为这些优质的特性,让它成为了让人爱不释手图片展示插件,下面我们就来说说它的使用。
1.在官网上下载js以及css库,在这里本人使用的是它的压缩版:
2.解压后找到jquery.prettyPhoto.js文件和prettyPhoto.css文件,放置到你的静态页面中
<link rel="stylesheet" type="text/css" href="css/prettyPhoto.css" media="screen" />
<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="js/prettyPhoto.js"></script><span style="font-family:SimSun;font-size:14px;"><span style="background-color: rgb(255, 255, 255);"></span></span><span style="font-size:14px;"></span>
3.初始化js,让页面支持 PrettyPhoto
<script type="text/javascript">
$(document).ready(function(){
$("a[rel^='prettyPhoto']").prettyPhoto();
});
</script>
4.页面内容
<body>
<a href="http://b.hiphotos.baidu.com/image/pic/item/9d82d158ccbf6c81a1f99ef7be3eb13532fa40e6.jpg" rel="prettyPhoto[pp_gal]" title="">
<img src="http://b.hiphotos.baidu.com/image/pic/item/9d82d158ccbf6c81a1f99ef7be3eb13532fa40e6.jpg" alt="this is text img" width="190" height="120"/>
</a>
<a href="http://g.hiphotos.baidu.com/image/pic/item/55e736d12f2eb9385505fcfbd7628535e5dd6f4b.jpg" rel="prettyPhoto[pp_gal]" title="">
<img src="http://g.hiphotos.baidu.com/image/pic/item/55e736d12f2eb9385505fcfbd7628535e5dd6f4b.jpg" alt="this is text img" width="190" height="120" style="display:none"/>
</a>
</body>
4.结果
如果你的英文功底不错呢 , 建议你直接到PrettyPhone官网查看演示或者学习:http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/
。
1.在官网上下载js以及css库,在这里本人使用的是它的压缩版:
2.解压后找到jquery.prettyPhoto.js文件和prettyPhoto.css文件,放置到你的静态页面中
<link rel="stylesheet" type="text/css" href="css/prettyPhoto.css" media="screen" />
<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="js/prettyPhoto.js"></script><span style="font-family:SimSun;font-size:14px;"><span style="background-color: rgb(255, 255, 255);"></span></span><span style="font-size:14px;"></span>
3.初始化js,让页面支持 PrettyPhoto
<script type="text/javascript">
$(document).ready(function(){
$("a[rel^='prettyPhoto']").prettyPhoto();
});
</script>
4.页面内容
<body>
<a href="http://b.hiphotos.baidu.com/image/pic/item/9d82d158ccbf6c81a1f99ef7be3eb13532fa40e6.jpg" rel="prettyPhoto[pp_gal]" title="">
<img src="http://b.hiphotos.baidu.com/image/pic/item/9d82d158ccbf6c81a1f99ef7be3eb13532fa40e6.jpg" alt="this is text img" width="190" height="120"/>
</a>
<a href="http://g.hiphotos.baidu.com/image/pic/item/55e736d12f2eb9385505fcfbd7628535e5dd6f4b.jpg" rel="prettyPhoto[pp_gal]" title="">
<img src="http://g.hiphotos.baidu.com/image/pic/item/55e736d12f2eb9385505fcfbd7628535e5dd6f4b.jpg" alt="this is text img" width="190" height="120" style="display:none"/>
</a>
</body>
4.结果
如果你的英文功底不错呢 , 建议你直接到PrettyPhone官网查看演示或者学习:http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/
。
相关文章推荐
- 可进可退,jQuery图片、视频、flash播放插件prettyPhoto使用记录
- jQuery图片播放插件prettyPhoto使用介绍
- jquery图片播放浏览插件prettyPhoto使用详解
- jquery图片播放浏览插件prettyPhoto使用详解
- jquery图片播放浏览插件prettyPhoto
- 一款基于jQuery可放大预览的图片滑块插件
- jquery cycle插件的使用,图片幻灯片播放效果
- 一张图片 点击鼠标放大,再点缩小 ( 基于jquery1.8.3), 另外推荐一款插件:lightBox...效果不错。
- 一款基于jQuery的图片下滑切换焦点图插件
- 一款基于jQuery和CSS3的图片层叠效果插件(附源码)
- 一款基于jQuery轮播切换焦点图,可播放多张图片
- 一款基于jQuery可自动播放动画的焦点图插件
- 一款基于jQuery的图片分组切换焦点图插件
- 【简报】一款使用静态图片生成动画的jQuery插件:JZoopraxiscope
- jquery图片播放插件Fancybox使用详解
- 一款基于jQuery轮播切换焦点图,可播放多张图片
- 一款基于jQuery的图片水平滑动插件
- 【转】jquery图片播放插件Fancybox使用方法
- jquery图片播放插件Fancybox使用详解
- 一款超炫的jquery图片播放插件[Cloud Carousel]