prettyPhoto 插件的使用 图片组浏览器 异步加载,iframe内容加载 弹出层
XML/HTML Code
- <div id="main">
- <h2>Gallery</h2>
- <ul class="gallery clearfix">
- <li><a href="images/fullscreen/1.JPG?lol=lol" rel="prettyPhoto[gallery1]" title="You can add caption to pictures. You can add caption to pictures. You can add caption to pictures."><img src="images/thumbnails/t_1.jpg" width="60" height="60" alt="Red round shape" /></a></li>
- <li><a href="images/fullscreen/2.jpg" rel="prettyPhoto[gallery1]"><img src="images/thumbnails/t_2.jpg" width="60" height="60" alt="Nice building" /></a></li>
- <li><a href="images/fullscreen/3.jpg" rel="prettyPhoto[gallery1]"><img src="images/thumbnails/t_3.jpg" width="60" height="60" alt="Fire!" /></a></li>
- <li><a href="images/fullscreen/4.jpg" rel="prettyPhoto[gallery1]"><img src="images/thumbnails/t_4.jpg" width="60" height="60" alt="Rock climbing" /></a></li>
- <li><a href="images/fullscreen/5.jpg" rel="prettyPhoto[gallery1]"><img src="images/thumbnails/t_5.jpg" width="60" height="60" alt="Fly kite, fly!" /></a></li>
- <li><a href="images/fullscreen/6.jpg" rel="prettyPhoto[gallery1]"><img src="images/thumbnails/t_2.jpg" width="60" height="60" alt="Nice building" /></a></li>
- </ul>
- <h2>Gallery 2</h2>
- <ul class="gallery clearfix">
- <li><a href="images/fullscreen/3.jpg" rel="prettyPhoto[gallery2]" title="How is the description on that one? How is the description on that one? How is the description on that one? "><img src="images/thumbnails/t_3.jpg" width="60" height="60" alt="This is a pretty long title" /></a></li>
- <li><a href="images/fullscreen/4.jpg" rel="prettyPhoto[gallery2]" title="Description on a single line."><img src="images/thumbnails/t_4.jpg" width="60" height="60" alt="" /></a></li>
- <li><a href="images/fullscreen/5.jpg" rel="prettyPhoto[gallery2]"><img src="images/thumbnails/t_5.jpg" width="60" height="60" alt="" /></a></li>
- <li><a href="images/fullscreen/1.jpg" rel="prettyPhoto[gallery2]"><img src="images/thumbnails/t_1.jpg" width="60" height="60" alt="" /></a></li>
- <li><a href="images/fullscreen/2.jpg" rel="prettyPhoto[gallery2]"><img src="images/thumbnails/t_2.jpg" width="60" height="60" alt="" /></a></li>
- </ul>
- <h2>API Call</h2>
- <script type="text/javascript" charset="utf-8">
- api_gallery=['images/fullscreen/1.JPG','images/fullscreen/2.jpg','images/fullscreen/3.JPG'];
- api_titles=['API Call Image 1','API Call Image 2','API Call Image 3'];
- api_descriptions=['Description 1','Description 2','Description 3'];
- </script>
- <p><a href="#" onClick="$.prettyPhoto.open(api_gallery,api_titles,api_descriptions); return false">API call</a></p>
- <h2>Picture alone</h2>
- <ul class="gallery clearfix">
- <li><a href="images/fullscreen/2.jpg" rel="prettyPhoto" title="<a href='http://www.google.ca' target='_blank' >This will open Google.com in a new window</a>"><img src="images/thumbnails/t_2.jpg" width="60" height="60" alt="Picture alone 1" /></a></li>
- </ul>
- <div class="fleft">
- <h2>Flash</h2>
- <ul class="gallery clearfix">
- <li><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="images/thumbnails/flash-logo.png" width="60" alt="Flash 10 demo" /></a></li>
- </ul>
- </div>
- <div class="fleft">
- <h2>YouTube</h2>
- <ul class="gallery clearfix">
- <li><a href="http://www.youtube.com/watch?v=kh29_SERH0Y?rel=0" rel="prettyPhoto" title="YouTube demo"><img src="images/thumbnails/flash-logo.png" width="60" alt="" /></a></li>
- <li><a href="http://youtu.be/kh29_SERH0Y?rel=0" rel="prettyPhoto" title="YouTube demo"><img src="images/thumbnails/flash-logo.png" width="60" alt="" /></a></li>
- </ul>
- </div>
- <div class="fleft">
- <h2>Vimeo</h2>
- <ul class="gallery clearfix">
- <li><a href="http://vimeo.com/7874398&width=700" rel="prettyPhoto" title="Vimeo video"><img src="images/thumbnails/flash-logo.png" width="60" alt="VIMEO!" /></a></li>
- </ul>
- </div>
- <br class="cboth" />
- <h2>Movies (.mov)</h2>
- <ul class="gallery clearfix">
- <li><a href="http://trailers.apple.com/movies/disney/tronlegacy/tronlegacy-tsr1_r640s.mov?width=640&height=272" rel="prettyPhoto[movies]" title="Tron!"><img src="images/thumbnails/quicktime-logo.gif" alt="Tron teaser" width="60" /></a></li>
- <li><a href="http://trailers.apple.com/movies/sony_pictures/karatekid/karatekid-tlr3_r640s.mov?width=640&height=304" rel="prettyPhoto[movies]" title="The Karate Kid"><img src="images/thumbnails/quicktime-logo.gif" alt="The Karate Kid" width="60" /></a></li>
- <li><a href="http://trailers.apple.com/movies/paramount/shutterisland/shutterisland-tvspot1_r640s.mov?width=640&height=272" rel="prettyPhoto[movies]" title="Shutter Island"><img src="images/thumbnails/quicktime-logo.gif" alt="Shutter Island" width="60" /></a></li>
- </ul>
- <h2>Movies (.mov) alone</h2>
- <ul class="gallery clearfix">
- <li><a href="http://trailers.apple.com/movies/disney/tronlegacy/tronlegacy-tsr1_r640s.mov?width=640&height=272" rel="prettyPhoto" title="Tron!"><img src="images/thumbnails/quicktime-logo.gif" alt="Tron teaser" width="60" /></a></li>
- </ul>
- <h2>Unusual sizes</h2>
- <ul class="gallery clearfix">
- <li><a href="images/fullscreen/wide.gif" rel="prettyPhoto[unusual]">Wide image (3000 x 1500)</a></li>
- <li><a href="images/fullscreen/high.gif" rel="prettyPhoto[unusual]">High image (1500 x 3000)</a></li>
- <li><a href="images/fullscreen/huge.gif" rel="prettyPhoto[unusual]">Huge image (3000 x 3000)</a></li>
- </ul>
- <h2>Iframe</h2>
- <ul class="gallery clearfix">
- <li><a href="http://www.163.com/iframe=true&width=100%&height=100%" rel="prettyPhoto[iframe]">163</a></li>
- <li><a href="http://www.baidu.com?iframe=true&width=600&height=300" rel="prettyPhoto[iframe]">baidu</a></li>
- <li><a href="http://freejs.net?iframe=true&width=300&height=200" rel="prettyPhoto[iframe]">My site</a></li>
- </ul>
- <h2>AJAX</h2>
- <ul class="gallery clearfix">
- <li><a href="xhr_response.html?ajax=true&width=400&height=160" rel="prettyPhoto[ajax]">Sample AJAX</a></li>
- </ul>
- <h2>Mixed gallery</h2>
- <ul class="gallery clearfix">
- <li><a href="http://www.google.ca?iframe=true&width=1000&height=500" rel="prettyPhoto[mixed]">Google.ca</a></li>
- <li><a href="http://trailers.apple.com/movies/disney/tronlegacy/tronlegacy-tsr1_r640s.mov?width=640&height=272" rel="prettyPhoto[mixed]" title="Tron!"><img src="images/thumbnails/quicktime-logo.gif" alt="Tron teaser" width="60" /></a></li>
- <li><a href="images/fullscreen/5.jpg" rel="prettyPhoto[mixed]"><img src="images/thumbnails/t_5.jpg" width="60" height="60" alt="" /></a></li>
- <li><a href="http://www.adobe.com/products/flashplayer/include/marquee/design.swf?width=792&height=294" rel="prettyPhoto[mixed]" title="Flash 10 demo"><img src="images/thumbnails/flash-logo.png" width="60" alt="Flash 10 demo" /></a></li>
- </ul>
- <h2>Inline content</h2>
- <ul class="gallery clearfix">
- <li><a href="#inline_demo" rel="prettyPhoto[inline]">Inline content 1</a></li>
- <li><a href="#inline_demo2" rel="prettyPhoto[inline]">Inline content 2</a></li>
- <li><a href="#inline_demo3" rel="prettyPhoto[inline]">Inline content 3</a></li>
- </ul>
- <div id="inline_demo" style="display:none;">
- <p>测试1</p>
- </div>
- <div id="inline_demo2" style="display:none;">
- 测试2
- </div>
- <div id="inline_demo3" style="display:none;">
- 测试3
- <p><img src="images/fullscreen/2.jpg" /></p>
- </div>
- <h2>Custom content</h2>
- <ul id="custom_content" class="gallery clearfix">
- <li><a href="#?custom=true&width=260&height=270" rel="prettyPhoto">Google Maps</a></li>
- <li><a href="#?custom=true&width=260&height=400" rel="prettyPhoto">Ads</a></li>
- </ul>
- <br /><br />
- <script type="text/javascript" charset="utf-8">
- $(document).ready(function(){
- $("area[rel^='prettyPhoto']").prettyPhoto();
- $(".gallery:first a[rel^='prettyPhoto']").prettyPhoto({animation_speed:'normal',theme:'light_square',slideshow:3000, autoplay_slideshow: true});
- $(".gallery:gt(0) a[rel^='prettyPhoto']").prettyPhoto({animation_speed:'fast',slideshow:10000, hideflash: true});
- $("#custom_content a[rel^='prettyPhoto']:first").prettyPhoto({
- custom_markup: '<div id="map_canvas" style="width:260px; height:265px"></div>',
- changepicturecallback: function(){ initialize(); }
- });
- $("#custom_content a[rel^='prettyPhoto']:last").prettyPhoto({
- custom_markup: '<div id="bsap_1259344" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6"></div><div id="bsap_1237859" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6" style="height:260px"></div><div id="bsap_1251710" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6"></div>',
- changepicturecallback: function(){ _bsap.exec(); }
- });
- });
- </script>
- <!-- Google Maps Code -->
- <script type="text/javascript"
- src="http://maps.google.com/maps/api/js?sensor=true">
- </script>
- <script type="text/javascript">
- function initialize() {
- var latlng = new google.maps.LatLng(-34.397, 150.644);
- var myOptions = {
- zoom: 8,
- center: latlng,
- mapTypeId: google.maps.MapTypeId.ROADMAP
- };
- var map = new google.maps.Map(document.getElementById("map_canvas"),
- myOptions);
- }
- </script>
- <!-- END Google Maps Code -->
- <!-- BuySellAds.com Ad Code -->
- <style type="text/css" media="screen">
- .bsap a { float: left; }
- </style>
- <script type="text/javascript">
- (function(){
- var bsa = document.createElement('script');
- bsa.type = 'text/javascript';
- bsa.async = true;
- bsa.src = '//s3.buysellads.com/ac/bsa.js';
- (document.getElementsByTagName('head')[0]||document.getElementsByTagName('body')[0]).appendChild(bsa);
- })();
- </script>
- <!-- END BuySellAds.com Ad Code -->
- </div>
原文地址:http://www.freejs.net/article_jquerywenzi_345.html