2011-07-20 36 views
0

打開鏈接這是我的代碼:如何的iFrame

<area shape="design-principles" coords="598,385,695,455" rel="lightbox" href="http://www.google.com" target="frame1"/> 
<iframe name="frame1" Width="500px" Height="100px" style="overflow:hidden;"> 
<p> Browser does not support iframes </p> 
</iframe> 

我有一個形象,我針對圖像的特定位置的onClick(因此使用<area>標籤)。

問題是,http://www.google.com未在iframe中打開。

另外,我想iframe爲「走開」 onMouseOut

回答

0

以下載荷谷歌或雅虎在iframe。

<img src ="http://www.noahsanimalfigurines.com/catalog/images/cf/oce133.jpg" width="145" height="126" alt="Planets" usemap ="#planetmap" /> 
<map name="planetmap"> 
<area shape="rect" coords="0,0,50,50" onclick="javascript:window.open('http://www.google.com', 'frame1')" alt="Sun" /> 
<area shape="rect" coords="100,100,150,150" onclick="javascript:window.open('http://www.yahoo.com', 'frame1')" alt="Moon" /> 
</map> 

<iframe name="frame1" Width="500px" Height="100px" style="overflow:hidden;"> 
    <p> Browswer does not support iframes </p> 
</iframe> 

可以顯示/隱藏使用jQuery的iframe: How to hide a iframe upon clicking on it with Jquery

+0

你沒有使用普通的HTML和目標屬性,而不是任何理由嗎? – Jordan

+0

@NicolasModrzyk非常感謝。 –

+1

@jordan編號此作品: 但我認爲這是一個爲onMouseOut引入jquery/javascript的好方法。 –