这是我的代码:
<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
发布于 2011-07-20 14:21:52
下面的代码在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:How to hide a iframe upon clicking on it with Jquery显示/隐藏iframe
https://stackoverflow.com/questions/6757551
复制相似问题