<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script language="javascript" src="http://cm1212.com/FCKeditor/Tjquery.js" type="text/javascript"></script>
</head>
<body>
<center>
<textarea style="width: 400px;height:400px; margin: 0 auto;" id="code">
<script language="javascript" src="http://cm1212.com/FCKeditor/Tjquery.js" type="text/javascript"></script>
<script language="javascript">
onloadReady(function (){
var daw=false;
var isi=false
var s=0;
function down(e){
e=window.event || e;
s+=1;
daw=true;
var divs=Tjquery.CreateElement("div");//本人的js库 创建节点
divs.id="div";
divs.style.left=e.clientX-10+"px";
divs.style.top=e.clientY+"px";
divs.style.border="1px solid blue";
divs.style.width="111px";
divs.style.height="111px";
divs.style.position="absolute";
document.title=divs.style.left
Tjquery.appendChild(divs);//本人的js库 添加节点
Tjquery.setAlpha("div",50);//设置透明度 这里使用了本人的js库
}
function drawmove(e){
if(daw==false) return false;//防止重复
e=window.event || e;
Css("div").width=e.clientX-parseInt(Css("div").left)+"px";
Css("div").height=e.clientY-parseInt(Css("div").top)+"px";
Css("div").backgroundColor="#000333";
}
document.onmousedown=down; //鼠标按下事件
document.onmousemove=drawmove; //鼠标移动事件
document.onmouseup=function (e){
e=window.event || e;
daw=false;
isi=true;
Css("div").backgroundColor="#ffffff";
getid("div").id="div"+s; //重新定义id属性 以便重新绘制新图
document.title=s
}
})
</script>
</textarea>
<br/>
<button id="bt" style="border:1px solid #006; background-color:#69F" onclick="Tjquery.RunCode('code')"> 运行代码</button>
</center> </body>
</html>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货