在悬停时更改iframe的高度? [英] Change height of an iframe on hover?
本文介绍了在悬停时更改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&source=s_q&hl=da&geocode=&q={$location}&output=embed"> </iframe><br /><small><a href="http://maps.google.dk/maps?f=q&source=embed&hl=da&geocode=&q=skive&sll=55.869147,11.228027&sspn=7.860459,28.54248&ie=UTF8&hq=&hnear=Skive&z=13&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屋!
查看全文