【问题标题】:Fancybox + swf gallery. Not resizing between itemsFancybox + swf 画廊。不在项目之间调整大小
【发布时间】:2012-01-29 09:06:59
【问题描述】:

请看这里的例子: (横幅 > 头晕流氓 > 查看更多+) http://www.ok-hybrid.com/store/wip/index.html

在浏览它们时,我希望每个横幅都以正确的大小显示。 照原样,它们都以 728x90 显示 - 画廊中第一条横幅的尺寸。

我用过:

$("a.fancybox_swf").each(function(){
   var $a = $(this);
   var h = $a.data("height")
   var w = $a.data("width");
   $a.fancybox({

            'width' : w, 
            'height': h

对于单个项目:

<a class="fancybox_swf" data-width="728" data-height="90" href="swf/dizcash_728x90.swf" rel="diztong">+</a>
<a class="fancybox_swf" data-width="300" data-height="250" href="swf/dizcash_300x250.swf" rel="diztong">+</a>
<a class="fancybox_swf" data-width="728" data-height="90" href="swf/dizholiday_728x90.swf" rel="diztong">+</a>
<a class="fancybox_swf" data-width="300" data-height="250" href="swf/dizholiday_300x250.swf" rel="diztong">+</a>

感谢收看。任何帮助表示赞赏。 P.

【问题讨论】:

    标签: flash fancybox


    【解决方案1】:

    只需使用普通的 fancybox 自定义脚本并使用 afterLoad 选项获取 widthheight,例如:

     $("a.fancybox_swf").fancybox({
      fitToView: false,
      afterLoad: function(){
       this.width = $(this.element).data("width");
       this.height = $(this.element).data("height");
      }
     }); // fancybox
    

    【讨论】:

    • 那么请不要忘记将此标记为正确答案,谢谢
    • 完成!对不起,新来的。再次感谢您的帮助。
    猜你喜欢
    • 2011-07-05
    • 2011-10-27
    • 1970-01-01
    • 1970-01-01
    • 2020-03-09
    • 2023-03-12
    • 2012-02-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多