欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

jquery圖片播放瀏覽插件prettyPhoto使用詳解

 更新時(shí)間:2014年12月19日 17:02:52   投稿:hebedich  
這篇文章主要詳細(xì)介紹了jquery圖片播放瀏覽插件prettyPhoto使用方法,以及支持的每種類型的詳細(xì)示例,非常的不錯(cuò),有需要的小伙伴參考下

一、prettyPhoto簡(jiǎn)介

1

prettyPhoto是一款基于jquery的輕量級(jí)的lightbox圖片播放瀏覽插件,它不僅支持圖片,還同時(shí)支持視頻、flash、YouTube、iframe和ajax。而且prettyPhoto配置和使用都十分簡(jiǎn)單,擴(kuò)展性也不錯(cuò),你可以最大限度地自定義prettyPhoto。目前,prettyPhoto兼容大部分主流的瀏覽器,包括令人糾結(jié)的IE6。

prettyPhoto插件的項(xiàng)目地址:http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/

建議英文好的朋友直接去官網(wǎng)上了解這個(gè)插件的用法,如果你的英文很爛,那么也別急,下面我就給大家來(lái)一一介紹prettyPhoto的使用方法。

二、prettyPhoto使用方法介紹

1、引入jquery核心庫(kù)和prettyPhoto插件庫(kù)以及prettyPhoto樣式表文件

復(fù)制代碼 代碼如下:

<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插件,以下是最簡(jiǎn)單的配置的js代碼

復(fù)制代碼 代碼如下:

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

下面是每種類型的html代碼

1、單張圖片

復(fù)制代碼 代碼如下:

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

2、圖片相冊(cè)

復(fù)制代碼 代碼如下:

<a href="images/fullscreen/1.jpg" rel="prettyPhoto[pp_gal]" title="You can add caption to pictures.">
<img src="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="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="images/thumbnails/t_3.jpg" width="60" height="60" alt="Fire!" />
</a>
<a href="images/fullscreen/4.jpg" rel="prettyPhoto[pp_gal]">
<img src="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="images/thumbnails/t_5.jpg" width="60" height="60" alt="Fly kite, fly!" />
</a>

3、單個(gè)flash

復(fù)制代碼 代碼如下:

4、YouTube視頻

復(fù)制代碼 代碼如下:

5、Vimeo

復(fù)制代碼 代碼如下:

<a href="

6、QuickTime影片

復(fù)制代碼 代碼如下:

<a title="Despicable Me" rel="prettyPhoto[movies]" href="

7、外部網(wǎng)站(iframe

復(fù)制代碼 代碼如下:

8、普通文本

復(fù)制代碼 代碼如下:

<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希望大家能喜歡,這個(gè)是播放普通文本的html</p>
</div>

9、AJAX內(nèi)容

復(fù)制代碼 代碼如下:

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

三、總結(jié)

prettyBox圖片播放插件很好用,趕緊用它來(lái)打造你的專屬相冊(cè)吧!

相關(guān)文章

最新評(píng)論