一 、prettyPhoto简介

prettyPhoto是一款基于jquery的轻量级的lightbox图片播放浏览插件,它不仅支持图片,还同时支持视频、flash、YouTube、iframe和ajax。

目前,prettyPhoto兼容大部分主流的浏览器,包括令人纠结的IE6。

prettyPhoto插件的项目地址:http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/

二、组件引用

1、引入jquery核心库和prettyPhoto插件库以及prettyPhoto样式表文件

<script src="js/jquery.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="css/prettyPhoto.css" type="text/css" media="screen" charset="utf-8" />
<script src="js/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8"></script>

2、初始化jquery插件,以下是最简单的配置的js代码

$(document).ready(function(){$("a[rel^='prettyPhoto']").prettyPhoto();
});

三、prettyPhoto使用方法介绍

1、单张图片

<a href="images/fullscreen/2.jpg" rel="prettyPhoto" title="This is the description">
<img src="data:images/thumbnails/t_2.jpg" width="60" height="60" alt="This is the title" />
</a>

2、图片相册

<a href="images/fullscreen/1.jpg" rel="prettyPhoto[pp_gal]" title="You can add caption to pictures."><img src="data:images/thumbnails/t_1.jpg" width="60" height="60" alt="Red round shape" />
</a>
<a href="images/fullscreen/2.jpg" rel="prettyPhoto[pp_gal]"><img src="data:images/thumbnails/t_2.jpg" width="60" height="60" alt="Nice building" />
</a>
<a href="images/fullscreen/3.jpg" rel="prettyPhoto[pp_gal]"><img src="data:images/thumbnails/t_3.jpg" width="60" height="60" alt="Fire!" />
</a>
<a href="images/fullscreen/4.jpg" rel="prettyPhoto[pp_gal]"><img src="data:images/thumbnails/t_4.jpg" width="60" height="60" alt="Rock climbing" />
</a>
<a href="images/fullscreen/5.jpg" rel="prettyPhoto[pp_gal]"><img src="data:images/thumbnails/t_5.jpg" width="60" height="60" alt="Fly kite, fly!" />
</a>

3、单个flash

<a href="http://www.adobe.com/products/flashplayer/include/marquee/design.swf?width=792&height=294"
rel="prettyPhoto[flash]" title="Flash 10 demo"><img src="data:images/thumbnails/flash-logo.jpg" alt="Flash 10 demo" width="60" />
</a>

4、YouTube视频

<a href="http://www.youtube.com/watch?v=qqXi8WmQ_WM" rel="prettyPhoto" title=""><img src="data:images/thumbnails/flash-logo.jpg" alt="YouTube" width="60" />
</a>

5、Vimeo

<a href="http://vimeo.com/8245346" rel="prettyPhoto" title=""> <img src="data:images/thumbnails/flash-logo.jpg" alt="YouTube" width="60" />
</a>

6、QuickTime影片

<a title="Despicable Me" rel="prettyPhoto[movies]" href="http://trailers.apple.com/movies/universal/despicableme/despicableme-tlr1_r640s.mov?width=640&height=360"><img src="/wp-content/themes/NMFE/images/thumbnails/quicktime-logo.png" alt="Despicable Me" width="50" /></a><a title="Tales from Earthsea" rel="prettyPhoto[movies]" href="http://trailers.apple.com/movies/disney/talesfromearthsea/talesfromearthsea-tlr1_r640s.mov?width=640&height=340"> <img src="/wp-content/themes/NMFE/images/thumbnails/quicktime-logo.png" alt="Tales from Earthsea" width="50" /> </a> <a title="Grease Sing-A-Long" rel="prettyPhoto[movies]" href="http://trailers.apple.com/movies/paramount/greasesingalong/greasesingalong-tlr1_r640s.mov?width=640&height=272"> <img src="/wp-content/themes/NMFE/images/thumbnails/quicktime-logo.png" alt="Grease Sing-A-Long" width="50" /></a>

7、外部网站(iframe)

<a href="http://www.google.com?iframe=true&width=100%&height=100%"
rel="prettyPhoto[iframes]" title="Google.com opened at 100%">Google.com</a>
<a href="http://www.apple.com?iframe=true&width=500&height=250" rel="prettyPhoto[iframes]">Apple.com</a>
<a href="http://www.twitter.com?iframe=true&width=400&height=200" rel="prettyPhoto[iframes]">Twitter.com</a>

8、普通文本

<a href="#inline-1" rel="prettyPhoto" ><img src="/wp-content/themes/NMFE/images/thumbnails/earth-logo.jpg" alt="" width="50" />
</a>
<div id="inline-1" class="hide"><p>这里是普通的文本</p><p>今天给大家介绍的prettyPhoto希望大家能喜欢,这个是播放普通文本的html</p>
</div>

9、AJAX内容

<a rel="prettyPhoto[ajax]" href="/demos/prettyPhoto-jquery-lightbox-clone/xhr_response.html?
ajax=true&width=325&height=185">Ajax content</a>

【JQ组件】prettyPhoto使用介绍相关推荐

  1. jQuery图片播放插件prettyPhoto使用介绍

    演示效果  http://www.17sucai.com/preview/131993/2014-07-09/mac-Bootstrap/gallery.html 点击之后的效果 使用方法 Query ...

  2. 小程序 video 控制器外观调整_「小程序JAVA实战」小程序视频组件与api介绍(51)...

    这次说下,小程序的视频组件,之前在说小程序基础的时候视频组件没说,现在说下.从属性和api都说下.https://github.com/limingios/wxProgram.git 中No.15 视 ...

  3. DNS术语,组件和概念介绍

    DNS术语,组件和概念介绍 2014年2月18日发布 255.4k个意见 DNS 概念LINUX基础常见问题 介绍 DNS或域名系统往往是学习如何配置网站和服务器的一个非常困难的部分.了解DNS如何工 ...

  4. 【微服务架构】SpringCloud组件和概念介绍

    [微服务架构]SpringCloud组件和概念介绍(一) 一:什么是微服务(Microservice)微服务英文名称Microservice,Microservice架构模式就是将整个Web应用组织为 ...

  5. 阿里云大数据组件的基本介绍

    阿里云大数据组件的基本介绍 注意:本文结合了本人对Hadoop生态和Spark的理解,阅读本文需要对传统的大数据组件有基本的认识和了解.本文不具备权威性,若要准确地了解阿里云大数据组件的特性请直接查看 ...

  6. MMKV数据存储组件的使用介绍

    MMKV数据存储组件的使用介绍 . 介绍 MMKV 是微信开源的基于 mmap 内存映射的 key-value 组件,底层序列化/反序列化使用 protobuf 实现,性能高,稳定性强.已移植到 An ...

  7. 日志组件Log2Net的介绍和使用(附源码开源地址)

    Log2Net是一个用于收集日志到数据库或文件的组件,支持.NET和.NetCore平台. 此组件自动收集系统的运行日志(服务器运行情况.在线人数等).异常日志.程序员还可以添加自定义日志. 该组件支 ...

  8. 地图可视化组件–folium简单介绍

    地图可视化组件–folium简单介绍 folium是基于Python环境开发的一个地图绘制包,可以在程序中引入从而绘制精美的地图数据可视化图表.folium建立在Python生态系统的数据处理能力和L ...

  9. SharePoint 2016 必备组件离线安装介绍

    前言 SharePoint 必备组件安装,一直以来都是SharePoint安装过程中的最大的坑,尤其是不能联网的服务器.博主在这里简单介绍一下离线安装过程,并附组件包下载以及安装命令,并且在windo ...

最新文章

  1. ML之回归预测:利用多个算法模型(LassoR、KernelRidgeR、ElasticNetR、GBR、LGBMR、XGBR)对国内某平台上海2020年6月份房价数据集【12+1】进行回归预测
  2. Oracle Spatial分区应用研究之一:分区与分表查询性能对比
  3. flask和vue的冲突问题
  4. Ghost 基于 Node.js 构建的开源博客平台
  5. MFC中模态对话框和非模态对话框的差别
  6. 【Cocoa(mac) Application 开发系列之二】总结一些常用控件及自定义View
  7. Vulkan学习(一):Vulkan环境搭建(Windows)官方教程--(Base code Instance Validation layers)
  8. IEEE Trans LaTex模板参考文献格式
  9. 总结《Video rate spectral imaging using a coded aperture snapshot spectral imager》
  10. python地图可视化前端页面展示_利用pyecharts实现地图可视化的例子
  11. 光盘刻录 CD刻录软件 Ashampoo Burning Studio特别版 刻录CD就这么简单
  12. 双系统后适合装matlab吗,安装双系统对电脑有什么影响|电脑装双系统有什么好处和坏处...
  13. 【七夕特别篇】七夕已至,让爱闪耀
  14. 软件安装【持续更新ing】
  15. git使用进阶(一)——工作区和log
  16. Java面向对象(OOP)--面向过程 面向对象 OOP详解
  17. 32.0.概率论与数理统计-依概率收敛,切比雪夫不等式
  18. ESXi主机定时开关机设置
  19. 个人计算机cpu型号,终于知道如何看懂一个电脑CPU型号了!
  20. html2canvas跨域踩坑日常

热门文章

  1. 21.04.14-用友元的方式实现复数类Complex的+=和*运算符
  2. Dplayer使用注意点
  3. 如何将电脑加入指定的域名
  4. UE Lyda项目学习 二、距离匹配 步幅适配 同步组
  5. NetApp 数据复制软件 SnapMirror
  6. 运维行业未来发展方向的规划
  7. c/c++ windows ble 蓝牙
  8. (2019春)软件构造:雨课堂试卷(四)(第6章)
  9. 2022年亚洲半导体50强
  10. 【node】nodemailer 实现邮件发送