【问题标题】:Where to put hideLoading method in the Fancybox 2 function在 Fancybox 2 函数中放置 hideLoading 方法的位置
【发布时间】:2012-03-09 07:42:38
【问题描述】:

我目前正在使用 fancyBox 2。就像一个魅力,很棒的工具。只是一件小事:我想禁用加载图标,但我不知道应该把它放在哪个回调中。这是我正在使用的代码:

$("a.iframe").each(function () {
  $(this).fancybox({
    'openEffect': 'elastic',
    'closeEffect': 'elastic',
    'margin': 0,
    'padding': 0,
    'topRatio': 0.1,
    'scrolling': 'no',
    'modal': true,
    'type': 'iframe',
    'afterLoad': function () {
      $.fancybox.hideLoading();
    },
    'afterShow': function () {
      var heightPane = $('.fancybox-iframe').contents().find('#content').height();
      $('.fancybox-iframe').contents().find('#pane2').css({
        'height': heightPane + 'px',
        'overflow': 'auto'
      })
    }
  })
});

把 $.fancybox.hideLoading();在 afterLoad 回调中不做任何事情。加载图标仍然出现。我什至把方法放在函数之前,图标仍然出现。

有人知道该怎么做吗?

【问题讨论】:

    标签: jquery icons fancybox hide loading


    【解决方案1】:

    作为一种解决方法,尝试添加一个 css 内联声明(在您加载了 fancybox css 文件之后):

    #fancybox-loading {display: none !important;}
    

    有一个选项 imgPreload 没有很好的文档记录,我认为它应该适用(替换加载图标或取消它)

    【讨论】:

      猜你喜欢
      • 2022-11-23
      • 1970-01-01
      • 1970-01-01
      • 2012-06-05
      • 1970-01-01
      • 2011-07-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多