使用的fancybox加载特定的分区模态窗口 [英] load specific div in modal window using fancybox

查看:117
本文介绍了使用的fancybox加载特定的分区模态窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在用的fancybox 2。我有管理通过AJAX来加载的fancybox内容。但它加载整个页面,我只关心具体的股利。在的fancybox 1中,我们可以做到这一点通过AJAX添加过滤器。但我不知道如何在的fancybox 2过滤

I am using fancybox 2. I have manage to load content in fancybox via AJAX. But it loads the whole page and I am only interested in specific div. In fancybox 1 we could do that by adding filter in ajax. But I am not sure how to filter in fancybox 2.

如何从AJAX加载页面的fancybox 2过滤特定的div?

How to filter specific div from AJAX loaded page in fancybox 2?

    $(".fancybox").fancybox({
        maxWidth    : 800,
        maxHeight   : 600,
        fitToView   : false,
        width       : '70%',
        height      : '70%',
        autoSize    : false,
        closeClick  : false,
        openEffect  : 'none',
        closeEffect : 'none',
        type        : 'ajax',
        'ajax'      : {
            dataFilter: function(data) {
            return $(data).find('#modalArticleContainer')[0];
        }
    });

取消平铺阿贾克斯它的工作原理,但加载整个页面,当我添加过滤器则停止工作。这是我怎么没pviously $ P $中的fancybox 1。

Untile ajax it works but loads whole page, when I add filter then it stops working. This is how I did previously in fancybox 1.

推荐答案

如果您使用的是最新的(https://github.com/fancyapps/fancyBox/zipball/master),那么还有一招加载特定元素从Ajax响应 -

If you are using the latest (https://github.com/fancyapps/fancyBox/zipball/master), then there is a trick to load specific element from the ajax response -

<a href="mypage.html #my_id" class="fancybox fancybox.ajax">Load ajax</a>

$(".fancybox").fancybox();

这篇关于使用的fancybox加载特定的分区模态窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆