Javascript鼠标触发窗口实例教程
资源介绍
首先在网页的Header标签处加入以下代码:
<SCRIPT LANGUAGE="Javascript">
var popupwindow_window = null;
function popupwindow(status,url) {
if(status != 0) {
if(popupwindow != null) popupwindow.focus();
else {
var popupwindow = open(url, "popupwindow", "width=350,height=225");
//这里设置弹出窗口的大小,宽度为350,高度为225.
popupwindow_window = popupwindow;
}
} else {
if(popupwindow_window != null) popupwindow_window.close();
}
}
</SCRIPT>
那如何调用这个JavaScript脚本呢?具体代码如下:
This is your link <A HREF="" onm ouseOver="popupwindow(1,popupwindow.html)"
onMouseout="popupwindow(0)"><img src="/images/picture.gif"
hspace=0 vspace=0 border=0 alt="Network"></A>
这样你只要将鼠标移过图片picture.gif的时候,就会弹出一个宽度为350,高度为225的网页了。