JS函数实现鼠标指向图片后显示大图代码
发布时间:2015-11-04 来源:查字典编辑
摘要:metahttp-equiv="Content-Type"content="text/html;charset=gb2312"/titleJ...
meta http-equiv="Content-Type" content="text/html; charset=gb2312" /titleJS函数实现鼠标指向图片后显示大图/titlescript language="javascript" function showPic(sUrl){ var x,y; x = event.clientX; y = event.clientY; document.getElementById("Layer1").style.left = x; document.getElementById("Layer1").style.top = y; document.getElementById("Layer1").innerHTML = "img src="" + sUrl + "" document.getElementById("Layer1").style.display = "block"; } function hiddenPic(){ document.getElementById("Layer1").innerHTML = ""; document.getElementById("Layer1").style.display = "none"; } /script/headbodyP/Pimg src="/images/logo.gif" onmouseout="hiddenPic();" onmousemove="showPic(this.src);" /p/p/body/html
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]