2012-01-29 84 views
0

之間不調整,請在這裏看到,例如: (旗>迪莉齊·拉斯卡爾>查看更多+) http://www.ok-hybrid.com/store/wip/index.htmlFancybox + swf畫廊。項目

,因爲它們是通過彈,我想每個橫幅在正確的大小顯示。 現在,它們全都以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.

回答

0

只需使用一個正常的fancybox自定義腳本,並與像afterLoad選項得到widthheight

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

非常感謝,也非常完美。 – 2012-03-10 08:15:53

+0

請不要忘記將此標記爲正確答案,謝謝 – JFK 2012-03-10 15:30:22

+0

完成!對不起,這裏是新的。再次感謝您的幫助。 – 2012-03-18 01:54:49