popup 弹出层弹出窗口 包括图片组浏览,ajax载入,地图等
popup 弹出层弹出窗口 包括图片组浏览,ajax载入,地图等
代码仅仅只显示一部分,更多内容请看演示页面
XML/HTML Code
- <a class="image-popup-vertical-fit" href="../dalian.jpg" title="Caption. Can be aligned it to any side."> <img src="../dalian.jpg" width="75" height="75"> </a> <a class="image-popup-fit-width" href="../dandong.png" title="This image fits only horizontally."> <img src="../dandong.png" width="75" height="75"> </a>
- <script>
- $(document).ready(function() {
- $('.image-popup-vertical-fit').magnificPopup({
- type: 'image',
- closeOnContentClick: true,
- mainClass: 'mfp-img-mobile',
- image: {
- verticalFit: true
- }
- });
- $('.image-popup-fit-width').magnificPopup({
- type: 'image',
- closeOnContentClick: true,
- image: {
- verticalFit: false
- }
- });
- $('.image-popup-no-margins').magnificPopup({
- type: 'image',
- closeOnContentClick: true,
- closeBtnInside: false,
- mainClass: 'mfp-no-margins', // class to remove default margin from left and right side
- image: {
- verticalFit: true
- }
- });
- });
- </script>
- <h2>Lightbox gallery</h2>
- <div class="popup-gallery"> <a href="../dalian.jpg" title="The Cleaner"><img src="../dalian.jpg" width="75" height="75"></a> <a href="http://farm9.staticflickr.com/8382/8558295631_0f56c1284f_b.jpg" title="Winter Dance"><img src="http://farm9.staticflickr.com/8382/8558295631_0f56c1284f_s.jpg" width="75" height="75"></a> <a href="../demo1.jpg" title="The Uninvited Guest"><img src="../demo1.jpg" width="75" height="75"></a> <a href="../demo2.jpg" title="Oh no, not again!"><img src="../demo2.jpg" width="75" height="75"></a> </div>
- <script>
- $(document).ready(function() {
- $('.popup-gallery').magnificPopup({
- delegate: 'a',
- type: 'image',
- tLoading: 'Loading image #%curr%...',
- mainClass: 'mfp-img-mobile',
- gallery: {
- enabled: true,
- navigateByImgClick: true,
- preload: [0,1] // Will preload 0 - before current, and 1 after the current image
- },
- image: {
- tError: '<a href="%url%">The image #%curr%</a> could not be loaded.',
- titleSrc: function(item) {
- return item.el.attr('title') + '<small>by Marsel Van Oosten</small>';
- }
- }
- });
- });
- </script>
相关推荐
周公周金桥 2020-09-06
大象从不倒下 2020-07-31
AlisaClass 2020-07-19
MaureenChen 2020-04-21
xingguanghai 2020-03-13
teresalxm 2020-02-18
木四小哥 2013-05-14
SoShellon 2013-06-01
Simagle 2013-05-31
羽化大刀Chrome 2013-05-31
waterv 2020-01-08
LutosX 2013-07-29
vanturman 2013-06-27
wutongyuq 2013-04-12
luoqu 2013-04-10
today0 2020-09-22
89520292 2020-09-18
bigname 2020-08-25