如何在具有显示库的放大弹出窗口中组合内联元素和图像
How can I combine inline elements with images in magnific popup having a displayed gallery
我正在使用放大弹出菜单。
我可以让它与画廊合作。
$(document).ready(function() {
$('.popup-gallery').magnificPopup({
delegate: 'a',
type: 'image',
gallery: {
enabled: true,
navigateByImgClick: true,
}
});
});
我还可以将内联元素与图像混合,这基本上就是我想要的:
$('#open-popup').magnificPopup({
items: [
{
src: 'http://upload.wikimedia.org/wikipedia/commons/thumb/6/64/Peter_%26_Paul_fortress_in_SPB_03.jpg/800px-Peter_%26_Paul_fortress_in_SPB_03.jpg',
title: 'Peter & Paul fortress in SPB'
},
{
src: 'http://vimeo.com/123123',
type: 'iframe' // this overrides default type
},
{
src: $('<div class="white-popup">Dynamically created element</div>'), // Dynamically created element
type: 'inline'
},
{
src: '<div class="white-popup">Popup from HTML string</div>', // HTML string
type: 'inline'
},
{
src: '#my-popup', // CSS selector of an element on page that should be used as a popup
type: 'inline'
}
],
gallery: {
enabled: true
},
type: 'image' // this is a default type
});
我的问题是,在混合示例中,我没有显示缩略图"库",我基本上想要的是thumbail图像,当点击时,它们的行为就像一个库,但中间有一个内联元素。
内联元素将有一个缩略图(和实际图像),但单击后将是一个内联元素。
我可以用fancybox做这件事,你可以在这里看到,如果你点击缩略图,它可能有助于澄清我需要什么。(我正试图用Magnific弹出来实现同样的事情,因为缺乏移动设备的移动支持)。
您可以将mfp-TYPE
CSS类添加到应该具有非默认内容类型的缩略图元素中。http://dimsemenov.com/plugins/magnific-popup/documentation.html#content_types
jQuery(document).ready(function($) {
$('.owl-wrapper').magnificPopup({
delegate: 'a',
type: 'image',
tLoading: 'Loading image #%curr%...',
mainClass: 'mfp-img-mobile',
gallery: {
enabled: true,
navigateByImgClick: true,
preload: [0,1]
},
image: {
tError: '<a href="%url%">The image #%curr%</a> could not be loaded.',
},
callbacks: {
elementParse: function(item) {
if(item.el.context.className == 'video-link') {
item.type = 'iframe';
} else if(item.el.context.className == 'inline-link') {
item.type = 'inline';
} else {
item.type = 'image';
}
}
},
});
});
相关文章:
- 创建一个类似链接的按钮,并通过Javascript函数打开一个新的弹出窗口
- 防止Iframe窗体在新窗口中打开
- 内部分区字体大小获胜'调整浏览器窗口大小时不会随媒体查询而更改
- 调整窗口大小时,可拖动的对象会出现在容器外部
- Javascript排序的图像弹出窗口..可以't单独弹出
- 窗口大小html css
- 根据id将json数组组合为一个json数组
- 弹出窗口出现,然后退出
- 为什么不是't窗口.恢复正常工作吗?(javascript/jquery)
- SAPUI5绑定从组合框控件到快速查看弹出窗口的路径
- 组合$window和$stateProvider以打开一个新的浏览器选项卡窗口
- 具有多个网格和组合的hbox/vbox布局的ExtJS窗口在Internet Explorer上渲染得非常慢
- 当其中一个选择器是“窗口”时组合选择器
- 将图像组合在一起并在窗口加载时对图像进行动画处理
- 灯箱投资组合窗口未弹出
- 如何在具有显示库的放大弹出窗口中组合内联元素和图像
- 窗口事件的JQuery函数:组合加载和调整大小
- ExtJs - Javascript -网格中的组合框(单元格编辑插件)-网格/窗口后面的下拉列表
- KML信息窗口在谷歌地图中与Fusion Tables层组合时出现故障
- 组合条件以检查是否移动或窗口是否已调整大小