javascript dragÀà
<!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>dragÀà</title>
</head>
<body>
<mce:style><!--
#pop{width:400px;background-color:#CCCCCC; border:1px solid #000;}
#popt{border:1px solid #000; border-left:none; border-right:none; cursor:move}
#btnclost{cursor:hand;float:right}
#popm{height:300px;}
#ddd{float:left}
--></mce:style><style mce_bogus="1">#pop{width:400px;background-color:#CCCCCC; border:1px solid #000;}
#popt{border:1px solid #000; border-left:none; border-right:none; cursor:move}
#btnclost{cursor:hand;float:right}
#popm{height:300px;}
#ddd{float:left}</style>
<div id="ddd" style="width:200px;height:200px;border:1px solid;background-color:#CCCCCC;cursor:move">
222222222222222222222222
</div>
<div id="pop" >
<span id="btnclost">X</span><div id="popt">±êÌâ±êÌâ±êÌâ±êÌâ±êÌâ±êÌâ</div>
<div id="popm">
ÄÚÈÝÄÚÈÝÄÚÈÝÄÚÈÝÄÚÈÝÄÚÈÝÄÚÈÝÄÚÈÝÄÚÈÝÄÚÈÝÄÚÈÝÄÚÈÝ
</div>
</div>
function $(o){return document.getElementById(o)}
//$('btnclost').onclick=function(){$('pop').style.display='none';}
var drag=function(obj,handle){
this.no=$(obj).cloneNode(true);
if($(obj)){
this.o=$(obj);
this.hd=(!$(handle)?this.o:$(handle));
this.hd.onmousedown=(function(e,no){
return function(e){
if(!e){var e=window.event}
x=$(obj).offsetLeft;
y=$(obj).offsetTop;
ow=e.clientX-x;
oh=e.clientY-y;
with(no.style){
position='absolute';
left=x+'px';
top=y+5+'px';
filter='Alpha(Opacity="30")';
}
document.body.appendChild(no);
document.onselectstart=function(){return false}
}
}
)(window.event,this.no)
this.no.onmouseup=function(e){
if(!e){var
Ïà¹ØÎĵµ£º
scrollHeight: »ñÈ¡¶ÔÏóµÄ¹ö¶¯¸ß¶È¡£
scrollLeft:ÉèÖûò»ñȡλÓÚ¶ÔÏó×ó±ß½çºÍ´°¿ÚÖÐÄ¿Ç°¿É¼ûÄÚÈݵÄ×î×ó¶ËÖ®¼äµÄ¾àÀë
scrollTop:ÉèÖûò»ñȡλÓÚ¶ÔÏó×¶ËºÍ´°¿ÚÖпɼûÄÚÈݵÄ×¶ËÖ®¼äµÄ¾àÀë
scrollWidth:»ñÈ¡¶ÔÏóµÄ¹ö¶¯¿í¶È
offsetHeight:»ñÈ¡¶ÔÏóÏà¶ÔÓÚ°æÃæ»òÓɸ¸×ø±ê offsetParent ÊôÐÔÖ¸¶¨µÄ¸¸×ø±êµÄ¸ß¶È
offsetL ......
<mce:script type="text/javascript" src="../jquery-1.2.3-intellisense.js" mce_src="jquery-1.2.3-intellisense.js"></mce:script>
<mce:script type="text/javascript"><!--
$(function() {
dayuan(200, 500, 200, 270, -90);
set ......
µ±Ò³Ãæ¼ÓÔØÒÔºó£¬Ö´ÐÐJavaScript£¬°´Ã뿪ʼ¼ÆÊý£º
JavaScript function£º
<SCRIPT language="JavaScript">
<!--Timer in JavaScript
var timerform
speed=1000
function dotimer()
{
today=new Date()
slutsec=today.getSeconds()
slutmin=today.getMinutes()
sluttim=today.getHours()
sluta=(slutse ......
×î½üÔÚÍøÉϲéÔÄÁ˲»ÉÙJavascript±Õ°ü(closure)Ïà¹ØµÄ×ÊÁÏ£¬Ð´µÄ´ó¶àÊǷdz£µÄѧÊõºÍרҵ¡£¶ÔÓÚ³õѧÕßÀ´Ëµ±ð˵Àí½â±Õ°üÁË£¬¾ÍÁ¬ÎÄ×ÖÐðÊö¶¼ºÜÄÑ¿´¶®¡£×«Ð´´ËÎĵÄÄ¿µÄ¾ÍÊÇÓÃ×îͨË×µÄÎÄ×Ö½Ò¿ªJavascript±Õ°üµÄÕæʵÃæÄ¿¡£
Ò»¡¢Ê²Ã´ÊDZհü£¿
“¹Ù·½”µÄ½âÊÍÊÇ£ºËùν“±Õ°ü”£¬Ö¸µÄÊÇÒ»¸öÓµÓÐÐí¶à±äÁ¿ºÍ°ó¶¨Á ......