0

如何将弹出窗口的以下 javascript 从“open popup onclick”更改为打开/关闭弹出 onmouseover/onmouseout。

<area alt="" coords="127, 22, 20" alt="" href="includes/popup1.htm" onclick="javascript:void window.open('includes/popup1.htm','1366002941508','width=500,height=200,left=350,top=250');return false;" shape="circle" />
4

1 回答 1

0

在打开弹出窗口时存储对弹出窗口的引用,并.close()在处理程序中调用窗口mouseout

<area
    onmouseover="popup = open('includes/popup1.htm','1366002941508','width=500,height=200,left=350,top=250');"
    onmouseout="popup && popup.close();"
    coords="127, 22, 20" alt="" href="includes/popup1.htm" shape="circle" />

但是,既然弹出窗口不是由点击触发的,那么您肯定会被弹出窗口阻止程序阻止。考虑在浮动 div 而不是单独的窗口中显示内容。

于 2013-04-16T05:23:46.100 回答