Fancybox + swf gallery. Not resizing between items

别说谁变了你拦得住时间么 提交于 2019-12-12 03:18:00

问题


Please see here for example: ( banners > dizzee rascal > see more+ ) http://www.ok-hybrid.com/store/wip/index.html

As they are flicked through, I'd like each banner to show at the correct size. As is, they are all showing at 728x90 - the dimensions of the 1st banner in the gallery.

I've used:

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

            'width' : w, 
            'height': h

and for the individual items:

<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>

Thanks for looking. Any help appreciated. P.


回答1:


Just use a normal fancybox custom script and get the width and height with the afterLoad option like:

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


来源:https://stackoverflow.com/questions/9052081/fancybox-swf-gallery-not-resizing-between-items

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!