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>
原文地址:http://www.freejs.net/article_jquerywenzi_197.html
最近更新
- jQuery轮播图插件slider-...
- CSS3鼠标悬停图片遮罩层变形动画特...
- 响应式全屏手风琴菜单,同时支持垂直方...
- 分组select选择器,支持多选和单...
- jQuery时间日期选择器代码日历插...
- Select 选择器 可以清空的单选...
我爱薅羊毛
点击最多
广告赞助
相关文章
- jquery点击显示或隐藏内容,可以一次展开多个和...
- tooltips/弹出层/消息提示效果,支持点击与...
- jQuery幸运大转盘抽奖活动代码
- jquery来实现的添加商品和减少商品数量,用于购...
- jQuery手机端弹出层提示对话框
- php js实现拖动滑块完成拼图验证码