2010-03-10 5 views
1

Comment modifier la hauteur d'un iFrame, en vol stationnaire, à l'aide de jQuery?Modifier la hauteur d'un iframe en vol stationnaire?

J'ai essayé ceci:

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

Mon iframe est:

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

Répondre

0

Votre code semble être bien, mais essayer cela aussi:

$('#googlemaps').attr('height', 300 + 'px'); 
0

Votre code est bien . Il semble que Google redimensionne l'iframe à sa taille d'origine. Supprimez les URL et vous verrez.

Questions connexes