腊月菊花代表什么生肖:[网页制作]怎么实现点击网页上的图象的热点弹出个对话框?

来源:百度文库 编辑:高考问答 时间:2024/05/10 20:03:53
我做了个网页,我想实现点击图片上的热点,然后弹出个确认对话框!
怎么做啊?

A:confirm对话框

<SCRIPT LANGUAGE="JavaScript">
function test1()
{
var aa= window.confirm("单击“确定”继续。单击“取消”停止。");
if (aa) {
window.alert("你选了确定!");
}
else window.alert("你选了取消!");
}
</script>
<img src="1.jpg" width="800" height="600" border="0" usemap="#Map">
<map name="Map">
<area shape="rect" coords="8,4,120,120" href="#" onclick="test1()">
</map>

=============================================
B:alert对话框

<img src="2.jpg" width="800" height="600" border="0" usemap="#Map">
<map name="Map">
<area shape="rect" coords="148,7,260,123" href="#" onclick="javascript:alert('看到了吗?')">
</map>

都写在onclick里~

在图片的获得焦点事件(onfocus)上 写JAVASCRIPT:alert("确认");