Introduction to jQuery image special effect script prettyPhoto,
PrettyPhoto is a jquery-based lightweight lightbox image special effect script. It not only supports images, but also supports videos, flash, YouTube, iframe, and ajax. In addition, prettyPhoto is easy to configure and use, and has good scalability. You can customize prettyPhoto as much as possible. PrettyPhoto is compatible with most mainstream browsers. Some Wordpress image extensions are based on this script.
For example, Wordpress Plugin: Royal PrettyPhoto
It is recommended that good English friends go to the official website to learn how to use this plug-in. If your English is poor, don't worry. Next I will introduce you to prettyPhoto one by one.
Http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/
I. Introduction to prettyPhoto
1. Introduce the jquery core library, prettyPhoto plug-in library, and prettyPhoto style sheet files.
<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. initialize the jquery plug-in. The following is the simplest configuration js Code.
- $ (Document). ready (function (){
- $ ("A [rel ^ = 'prettyphoto ']"). prettyPhoto ();
- });
The following is the html code of each type.
1. Single Image
- <A href = "images/fullscreen/2.jpg" rel =" prettyPhoto "title =" This is the description ">
- </A>
2. Image album
- <A href = "images/fullscreen/1.jpg" rel =" prettyPhoto [pp_gal] "title =" You can add caption to pictures. ">
- </A>
- <A href = "images/fullscreen/2.jpg" rel =" prettyPhoto [pp_gal] ">
- </A>
- <A href = "images/fullscreen/3.jpg" rel =" prettyPhoto [pp_gal] ">
- </A>
- <A href = "images/fullscreen/4.jpg" rel =" prettyPhoto [pp_gal] ">
- </A>
- <A href = "images/fullscreen/5.jpg" rel =" prettyPhoto [pp_gal] ">
- </A>
3. A single flash
- <A href = "http://www.adobe.com/products/flashplayer/include/marquee/design.swf? Width = 792 & amp; height = 294"
- Rel = "prettyPhoto [flash]" title = "Flash 10 demo">
- </A>
4. YouTube videos
- <A href = "http://www.youtube.com/watch? V = qqXi8WmQ_WM "rel =" prettyPhoto "title =" ">
- </A>
5. Vimeo
- <A href = "http://vimeo.com/8245346" rel = "prettyPhoto" title = "">
- </A>
6. QuickTime video
- <A title = "Despicable Me" rel = "prettyPhoto [movies]"
- Href = "http://trailers.apple.com/movies/universal/despicableme/despicableme-tlr1_r640s.mov? Width = 640 & height = 360 ">
- </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 ">
- </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 ">
- </A>
7. external website (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. common text
- <A href = "# inline-1" rel = "prettyPhoto"> </a>
- <Div id = "inline-1" class = "hide">
- <P> common text </p>
- <P> the prettyPhoto introduced to you today is the html for normal text playback. </p>
- </Div>
9. AJAX content
- <A rel = "prettyPhoto [ajax]" href = "/demos/prettyPhoto-jquery-lightbox-clone/xhr_response.html?
- Ajax = true & width = 325 & height = 185 "> Ajax content </a>
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.