【问题标题】:Display loading.gif until page is loaded in iframe inside jquery ui dialog显示 loading.gif,直到页面加载到 jquery ui 对话框内的 iframe 中
【发布时间】:2010-09-24 04:56:12
【问题描述】:

我想在点击带有 iframe 的 jquery ui 对话框时显示 loading.gif,直到页面加载到 iframe 中。有人知道这个问题吗?可能吗? 这是我的代码:

$('.dialog').click(function(e) {

    e.preventDefault();
    var $this = $(this);
    var horizontalPadding = 30;
    var verticalPadding = 30;

    $('<iframe id="externalSite" class="externalSite" src="' + this.href + '" />').dialog({
        title: ($this.attr('title')) ? $this.attr('title') : 'External Site',
        autoOpen: true,
        width: 800,
        height: 500,
        modal: true,
        buttons: {
            "Zatvori": function() {
                $(this).dialog("close");
            } 
        },

        resizable: true,
        autoResize: true,
        overlay: {
            opacity: 0.5,
            background: "black"
        },

        close: function(event, ui) {
            $(function() {
                var theVal = $.cookies.get('updatedForm');

                if (theVal != null) {
                    $.cookies.del('updatedForm');
                    location.reload(true);
                }
            });
        }

    }).width(800 - horizontalPadding).height(500 - verticalPadding);

【问题讨论】:

  • 也许通过使用 ui 对话框实现块 ui?但是怎么做呢?

标签: jquery-plugins jquery-ui-dialog


【解决方案1】:

问题解决了。我在以利亚庄园博客上发布了这个问题(上面的代码来自他的博客) http://elijahmanor.com/webdevdotnet/post/jQuery-UI-Dialog-w-Resizable-iFrame.aspx#id_6dccd7c1-56da-49b3-bb61-3b50a12aae45 并得到了 Dan 的解决方案,他发布了 jQuery Frame Dialog 插件的博客链接。

希望这对某人有所帮助。这对我帮助很大。

【讨论】:

  • 提供的链接现在是 404
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-02-27
  • 1970-01-01
  • 1970-01-01
  • 2011-02-05
  • 2011-07-09
相关资源
最近更新 更多