【问题标题】:fancybox: change height and width property after花式框:更改后的高度和宽度属性
【发布时间】:2011-01-10 20:43:53
【问题描述】:

是的,我有一个指定高度和宽度的简单花式框。

当您单击此花式框内的链接时,它会运行 ajax 请求。如果这个请求成功,我希望fancybox 改变高度和宽度。

【问题讨论】:

    标签: jquery fancybox


    【解决方案1】:

    为您的 ajax 创建一个 div,并创建另一个来包含它。将包含的 div 设置为固定高度和overflow: hidden。当 ajax 加载在内部 div 上使用 jQuery 运行 .height() 时,然后分配一个变量并让容器 .animate() 适应。

    【讨论】:

      【解决方案2】:

      有点晚但仍然有效:

      $.fancybox.update()
      
      // Auto-sizes fancyBox height to match height of content
      

      $.fancybox.toggle()
      
      // If content is resized to fit inside viewport than it will be expanded to full size (and vice verse)
      

      【讨论】:

        猜你喜欢
        • 2019-08-11
        • 1970-01-01
        • 2013-07-08
        • 1970-01-01
        • 1970-01-01
        • 2014-09-26
        • 1970-01-01
        • 2016-05-15
        • 1970-01-01
        相关资源
        最近更新 更多