<style>
.aa {position:relative;cursor:move;}
</style>
<script language="javascript">
<!--
// Author: Unkonw
// Modify: 枫岩@CnLei.com
var ie=document.all;
var nn6=document.getElementById&&!document.all;
var isdrag=false;
var y,x;
var oDragObj; function moveMouse(e) {
if (isdrag) {
oDragObj.style.top = (nn6 ? nTY + e.clientY - y : nTY + event.clientY - y)+"px";
oDragObj.style.left = (nn6 ? nTX + e.clientX - x : nTX + event.clientX - x)+"px";
return false;
}
} function initDrag(e) {
var oDragHandle = nn6 ? e.target : event.srcElement;
var topElement = "HTML";
while (oDragHandle.tagName != topElement && oDragHandle.className != "aa") {
oDragHandle = nn6 ? oDragHandle.parentNode : oDragHandle.parentElement;
}
if (oDragHandle.className=="aa") {
isdrag = true;
oDragObj = oDragHandle;
nTY = parseInt(oDragObj.style.top+0);
y = nn6 ? e.clientY : event.clientY;
nTX = parseInt(oDragObj.style.left+0);
x = nn6 ? e.clientX : event.clientX;
document.onmousemove=moveMouse;
return false;
}
}
document.onmousedown=initDrag;
document.onmouseup=new Function("isdrag=false"); </script>
</head>
<body >
<img src="http://webdesign.chinaitlab.com/UploadFiles_8014/200612/20061202115506895.gif" class="aa" />
<img src="http://webdesign.chinaitlab.com/UploadFiles_8014/200612/20061202115506895.gif" class="aa" />
<img src="http://webdesign.chinaitlab.com/UploadFiles_8014/200612/20061202115506895.gif" class="aa" /><br /><br />
<div class="aa"> <INPUT TYPE="text" NAME="test" value="test" onclick="msg()"></div>
</body >
.aa {position:relative;cursor:move;}
</style>
<script language="javascript">
<!--
// Author: Unkonw
// Modify: 枫岩@CnLei.com
var ie=document.all;
var nn6=document.getElementById&&!document.all;
var isdrag=false;
var y,x;
var oDragObj; function moveMouse(e) {
if (isdrag) {
oDragObj.style.top = (nn6 ? nTY + e.clientY - y : nTY + event.clientY - y)+"px";
oDragObj.style.left = (nn6 ? nTX + e.clientX - x : nTX + event.clientX - x)+"px";
return false;
}
} function initDrag(e) {
var oDragHandle = nn6 ? e.target : event.srcElement;
var topElement = "HTML";
while (oDragHandle.tagName != topElement && oDragHandle.className != "aa") {
oDragHandle = nn6 ? oDragHandle.parentNode : oDragHandle.parentElement;
}
if (oDragHandle.className=="aa") {
isdrag = true;
oDragObj = oDragHandle;
nTY = parseInt(oDragObj.style.top+0);
y = nn6 ? e.clientY : event.clientY;
nTX = parseInt(oDragObj.style.left+0);
x = nn6 ? e.clientX : event.clientX;
document.onmousemove=moveMouse;
return false;
}
}
document.onmousedown=initDrag;
document.onmouseup=new Function("isdrag=false"); </script>
</head>
<body >
<img src="http://webdesign.chinaitlab.com/UploadFiles_8014/200612/20061202115506895.gif" class="aa" />
<img src="http://webdesign.chinaitlab.com/UploadFiles_8014/200612/20061202115506895.gif" class="aa" />
<img src="http://webdesign.chinaitlab.com/UploadFiles_8014/200612/20061202115506895.gif" class="aa" /><br /><br />
<div class="aa"> <INPUT TYPE="text" NAME="test" value="test" onclick="msg()"></div>
</body >
<script>
window.onload=function(){
document.onmouseover=function(){
window.theImg=null;
}
var imgs=document.images;
for(var i=0;i<imgs.length;i++){
var img=imgs[i];
img.ondrag=function(){
window.theImg=this;
}
}
var txt=document.getElementById("txt");
txt.onmouseover=function(){
if(window.theImg!=null)this.value=window.theImg.title;
}
}
</script>
<body>
<img src="01.jpg" style="width:200;height:200" title="图片1" />
<img src="02.jpg" style="width:200;height:200" title="图片2" /><textarea id="txt"></textarea>
</body>
</html>
<html>
<body>
<p>
<script>
var is_add_text=false ; function drage_init(){
is_add_text=false ;
}function abc(img){
var textareas=document.all;
for(var i=0;i<textareas.length;i++){
var obj = textareas[i];
if ((obj.type == 'textarea')||(obj.type=='text')){
add_word(obj,img);
}
}
}function add_word(obj,img){ obj.onmouseover = function(){
if ((obj!=null)&&(is_add_text==false)){
obj.value += img.title+" ";
obj=null;
is_add_text = true;
}
};
}
</script>
<div style="background-color:#FF0000; width:500px; height:200px;" >
<img src="http://www.baidu.com/img/logo-yy.gif" ondragend="abc(this);this.style.url='http://webme.bokee.com/inc/mouse049.ani'" onmouseover="drage_init()" title="http://www.baidu.com/img/logo-yy.gif" /></p>
</div>
<p> </p>
<p> </p>
<p> </p><p>
<textarea id="a" style="height:200px; width:300px;" ></textarea>
</p>
<p> </p>
<p> </p>
<textarea id="b" style="height:200px; width:300px;" ></textarea>
</body>
</html>