在悬停时更改iframe的高度? [英] Change height of an iframe on hover?

查看:65
本文介绍了在悬停时更改iframe的高度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在悬停时使用jQuery更改iFrame的高度?

How do i change the height of an iFrame, on hover, using jQuery?

我已经尝试过:

<script type="text/javascript"> 
  $(document).ready(function(){
    $(".googlemaps").hover( function(){
      $('#googlemaps').height(300);
    });
  });
</script>

我的iframe是:

<div class="googlemaps">
 <xsl:variable name="location"><xsl:value-of select="DocumentEdition/Fields/Field[@Name = 'Location']" /></xsl:variable>
 <iframe id="googlemaps" width="489" height="215" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.dk/maps?f=q&amp;source=s_q&amp;hl=da&amp;geocode=&amp;q={$location}&amp;output=embed">&#160;</iframe><br /><small><a href="http://maps.google.dk/maps?f=q&amp;source=embed&amp;hl=da&amp;geocode=&amp;q=skive&amp;sll=55.869147,11.228027&amp;sspn=7.860459,28.54248&amp;ie=UTF8&amp;hq=&amp;hnear=Skive&amp;z=13&amp;ll=56.565498,9.021939" style="color:#0000FF;text-align:left">Vis stort kort</a></small>
</div>

推荐答案

您的代码很好. Google似乎正在将iframe调整为原始大小.删除网址,您会看到.

Your code is fine. It seems that Google is resizing the iframe back to its original size. Remove the URLs and you'll see.

这篇关于在悬停时更改iframe的高度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆