WEB开发网
开发学院网页设计JavaScript JS特效:鼠标移动到图片放大的效果 阅读

JS特效:鼠标移动到图片放大的效果

 2010-09-14 12:56:52 来源:WEB开发网   
核心提示:你的表格的标签要一样,而且HEIGHT和WIDTH要用100%<SCRIPT LANGUAGE="JavaScript">var offsetX=120;var offsetY=00;function Fpop(){var oImg =event.srcElement;var px =o

你的表格的标签要一样,而且HEIGHT和WIDTH要用100%

<SCRIPT LANGUAGE="JavaScript">
var offsetX=120;
var offsetY=00;
function Fpop()
{
var oImg =event.srcElement;
var px =oImg.offsetLeft;
var py =oImg.offsetTop;
popDiv.innerHTML ="<img src=""+oImg.src+"" />"
popDiv.style.left =px+offsetX;
popDiv.style.top =py+offsetY;
popDiv.style.display="";
}
function Fhidden()
{
popDiv.style.display="none";
}
</SCRIPT>
<div id="popDiv" style="position:absolute;z-index:10;border:1px solid black;display:none;"></div>
<img src=http://tech.ddvip.com/2007-01/"http://www.ddvip.com/images/logo1.gif" width="120" height="55" onmouseout="Fhidden()" onmouseover="Fpop()">
<Img Src=http://tech.ddvip.com/2007-01/"http://www.ddvip.com/images/logo.gif" width=250hight=75 Border=0 onMouseOver='this.width=500' onMouseOut='this.width=250'>
<Img Src=http://tech.ddvip.com/2007-01/"http://www.ddvip.com/images/logo.gif" width=125 Border=0 onMouseOver='this.width=this.width*2' onMouseOut='this.width=this.width/2'>

Tags:JS 特效 鼠标

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接