Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ѧϰÓÃJavaScript»­Ò»¸öЦÁ³


<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);
setTimeout(" dayuan(50, 420, 150, 180, 0);", 5000);
setTimeout(" dayuan(50, 590, 150, 180, 0);", 9000);
setTimeout(" dayuan(50, 500, 250, 0, -180);", 13000);

}
)
function dayuan(r,x,y,a,c) { //r Ô²°ë¾¶,x Ô²Ðĵĺá×ø±ê,a Æðʼ½Ç¶È,y Ô²ÐÄ×Ý×ø±ê,c ÖÕµã×ø±ê
var div = document.getElementById("div1");
var xs = setInterval(function test() {
var b = (Math.PI * (a)) / 180; //½Ç¶È»»³É»¡¶È
a = a - 1; //ÿһ´Î°´Ò»¶ÈµÝ¼õ
div.style.top = eval(y - r * Math.sin(b)) + "px"; //ÉèÖÃеÄ×ø±ê
div.style.left = eval(x + r * Math.cos(b)) + "px";
var off = $("#div1").offset(); //»ñȡеÄ×ø±ê
$("body").append("<div id='div" + off.left + off.top + "' class=\"te\"></div>"); //Ìí¼ÓÔ²µÄÿһ¸öµã
var divx = document.getElementById("div" + off.left + off.top);
divx.style.left = off.left+"px"; //ÉèÖÃÔ²µÄÿһ¸öµãµÄ×ø±ê
divx.style.top = off.top+"px";
// alert($("#div" + off.left + off.top).offset().left+" "+off.left);
if (a == c) {
clearInterval(xs);
}
}, 10);
}




// --></mce:script>

#div1
{
width:5px;
height:5px;
background-color:Black;
position:absolute;
top:100px;
left:50px;
overflow:hidden;
}
.te
{
position:absolute;
width:5px;
height:5px;
background-color:#ff0000;
overflow:hidden;
}

html´úÂë
<div id="div1"></div>


Ïà¹ØÎĵµ£º

JavaScript¶¯Ì¬Éú³ÉÊ÷Ðβ˵¥´´½¨±í¸ñ

<!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">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<head>
<title>ÎÞÏÞ¼¶Ê÷Ð ......

Àí½âJavascript±Õ°ü(closure)

Àí½âJavascript±Õ°ü(closure)
רÌâ Ô­Ìû http://www.w3cgroup.com/article.asp?id=87
´ËÎÄÓÃͨË×µÄÎÄ×Ö½éÉÜÁËJavascript±Õ°ü ¡£
¿´¹ýºó£¬ÎÒ¶Ôjavascript±Õ°ü¼òµ¥µÄÀí½â¾ÍÊÇ ÎÄÖеÚËÄ¡¢Îå¶ÎÖÐËù˵µÄ“ÔÚÄÚ´æÖÐά³ÖÒ»¸ö±äÁ¿£¬²»»á±»GC»ØÊÕ”¡£
µ±È»»¹ÐèҪѧϰ²ÅÄÜÉîÈëµÄÀí½âjavascript±Õ°ü
Ò»¡¢Ê²Ã´ÊDZհü£¿ ......

ͨ¹ýJavaScript½«ÊäÈë¿òÉèÖÃΪֻ¶Á

×¢Ò⣺readOnlyÖеÄOÒª´óд
//Ò³Ãæ³õʼ»¯Â¼È룬ÅжÏÖ¸±ê˵Ã÷ÊÇ·ñΪ¹¤×ÊÐÔÖ§³ö¡£
  function init() {
   var mark = "<%=mark%>";
   //Èç¹ûÖ¸±ê˵Ã÷Ϊ“¹¤×ÊÐÔÖ§³ö”£¬Ôò¹¤×ÊÖ§³öÄÇÒ»Ïî±äΪֻ¶Á£¬ÇÒֵΪ“Ö¸±ê¿ÉÓýð¶î”£»ÆäËû¼Èë¿ò¶¼²»¿É¼Èë¡£ ......

JavaScript KeyCodeÊý×Ö¼üÅ̶ÔÓ¦

keycode    8 = BackSpace BackSpace
keycode    9 = Tab Tab
keycode   12 = Clear
keycode   13 = Enter
keycode   16 = Shift_L
keycode   17 = Control_L
keycode   18 = Alt_L
keycode   19 = Pause
keyc ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ