【问题标题】:Dynamically resize the height of FancyBox动态调整 FancyBox 的高度
【发布时间】:2012-02-10 07:32:14
【问题描述】:

当我单击“显示评论”链接时,我希望 Fancybox 的高度会自动调整其自身的大小,该链接会滑下 Disqus 元素。

$(".video").fancybox({

    'transitionIn'      : 'none',
    'padding'       :'0',
    'transitionOut'     : 'none',
    'overlayColor'      : '#ebeeef',



});

这就是我目前使用的,我知道我可以以某种方式使用

    $.fancybox.resize();

但我不确定将它放在哪里以及如何链接它,以便在单击 div 时它会重新调整大小。

【问题讨论】:

    标签: jquery dynamic resize height fancybox


    【解决方案1】:

    假设您想用来触发调整大小的“显示评论”链接的 ID 为 #showComments。然后您可以在已有的 JavaScript 之后添加类似这样的内容:

    $("#showComments").click( function {
        $.fancybox.resize();
    } );
    

    这应该调整 Fancybox 的高度以匹配点击链接时其内容的高度。

    【讨论】:

      猜你喜欢
      • 2011-11-14
      • 1970-01-01
      • 2016-04-03
      • 2014-05-19
      • 2018-02-13
      • 1970-01-01
      • 1970-01-01
      • 2011-11-25
      • 2015-03-25
      相关资源
      最近更新 更多