日期:2014-05-18 浏览次数:20137 次
鼠标拖拽文字特效
以下是HTML网页特效代码,点击运行按钮可查看效果: 以下是程序代码<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE> New Document </TITLE> <META NAME="Generator" CONTENT="EditPlus"> <META NAME="Author" CONTENT=""> <META NAME="Keywords" CONTENT=""> <META NAME="Description" CONTENT=""> <script type="text/javascript"> function drag(o){ o=document.getElementById(o); o.style.position="absolute"; o.onmousedown=function(e){ e=e||window.event; var x=e.layerX||e.offsetX; var y=e.layerY||e.offsetY; document.onmousemove=function(e){ e=e||window.event; o.style.left=(e.clientX-x)+"px"; o.style.top=(e.clientY-y)+"px";}; document.onmouseup=function(){document.onmousemove=null;o.onmousedown=null;};};} </script> </HEAD> <BODY> <div id="cen"> <p class="control" style="margin-bottom:10px;" title="拖拽" onmousedown="drag('cen')">点俺拖拽</p> <p>1111111111111111111111</p> <p>111111111111111</p> <p>1111111111</p></div> </BODY> </HTML></font> <a href="http://js.aiyiweb.com/">欢迎访问爱易网网页特效代码站,js.aiyiweb.com</a> [Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]