2012-09-06 29 views
1

我在此页面使用FancyBox 2:http://encoreazalea.com/ee/botanical-gardens以在弹出窗口中显示Google地图。为什么不FancyBox窗口大小调整?

窗户很好,但所有的地图都有滚动条。我尝试调整显示窗口的大小,但它似乎没有正确响应我发送的指令。

下面是HTML:

<h3 class="state">Washington D.C.</h3> 

<div class="gardens"> 

<p class="garden">US National Arboretum<br /> 
<a href="http://www.usna.usda.gov/">Website</a> | <a class="map" href="#directions5148">Directions</a></p> 
</div> 

<div class="gardens"> 
<div id="directions5148" style="display:none"> 
<iframe width="600" height="440" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?ie=UTF8&amp;q=US+National+Arboretum&amp;fb=1&amp;gl=us&amp;hq=US+National+Arboretum&amp;hnear=US+National+Arboretum&amp;cid=0,0,12451978746893569755&amp;t=h&amp;ll=38.912424,-76.96852&amp;spn=0.008014,0.013733&amp;z=16&amp;iwloc=A&amp;output=embed"></iframe><br /><small><a href="https://maps.google.com/maps?ie=UTF8&amp;q=US+National+Arboretum&amp;fb=1&amp;gl=us&amp;hq=US+National+Arboretum&amp;hnear=US+National+Arboretum&amp;cid=0,0,12451978746893569755&amp;t=h&amp;ll=38.912424,-76.96852&amp;spn=0.008014,0.013733&amp;z=16&amp;iwloc=A&amp;source=embed" style="color:#0000FF;text-align:left">View Larger Map</a></small> 

</div> 

</p> 
</div> 

这里是jQuery的:

<script type="text/javascript"> 
    $(".map").fancybox({ 
      wrapCSS : 'fancybox-custom', 
      width : 700, 
      height : 600, 
      closeClick : true, 
      helpers : { 
       title : { 
        type : 'inside' 
       }, 
       overlay : { 
        css : { 
         'background-color' : '#eee' 
        } 
       } 
      } 
     }); 
</script> 

不管我怎么设置窗口的宽度和高度始终显示在相同的大小,有滚动地图周围的酒吧。

我的目标是摆脱滚动条。

谢谢。

回答

-1

这是愚蠢的,但因为我还没有包括在此的fancybox未正确响应:

$(document).ready(function() {... 

后,我加入了代码的其余部分变得更加敏感。

1

我会尝试添加尺寸直接到div来代替:

<div id="directions5148" class="map_window" style="display:none"> 

CSS:

.map_window{ 
    width: 700px; 
    height: 600px; 
    overflow: hidden; 
} 
1

您可能还需要设置的选项autoSize : falsefitToView : falsescrolling: "no"得到你想要的大小。