0

这是我的代码:

<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

4

1 回答 1

0

下面在 iframe 中加载 google 或 yahoo。

<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 on click on it with Jquery

于 2011-07-20T06:21:51.643 回答