Jquery 是否更改悬停时iframe的高度?
如何使用jQuery在悬停时更改iFrame的高度 我试过这个:Jquery 是否更改悬停时iframe的高度?,jquery,height,Jquery,Height,如何使用jQuery在悬停时更改iFrame的高度 我试过这个: <script type="text/javascript"> $(document).ready(function(){ $(".googlemaps").hover( function(){ $('#googlemaps').height(300); }); }); </script> $(文档).ready(函数(){ $(“.googlemaps”).hov
<script type="text/javascript">
$(document).ready(function(){
$(".googlemaps").hover( function(){
$('#googlemaps').height(300);
});
});
</script>
$(文档).ready(函数(){
$(“.googlemaps”).hover(函数(){
$("谷歌地图")。高度(300);
});
});
我的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>
您的代码似乎很好,但也可以尝试以下操作:
$('#googlemaps').attr('height', 300 + 'px');
你的代码很好。谷歌似乎正在将iframe的大小调整回原来的大小。删除URL,您将看到