ÓÃJavaScriptдµÄСʱºòÍæµÄƹÅÒÇòСÓÎÏ·
ÓÉÓÚ»ðºüä¯ÀÀÆ÷²»Ö§³Ö“removeNode”º¯Êý£¬ËùÒÔһϴúÂëÖ»Ö§³ÖIE.
<!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>
<title>--ƹÅÒÇò--</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<style>
.main{
width:690px;
margin:0 auto;
}
#box{
width:680px;
height:340px;
border:1px solid green;
position:relative;
}
.pingpang{
position:absolute;
width:10px;
height:10px;
background-color:red;
overflow:hidden;
}
.pingpangpai{
position:absolute;
width:60px;
height:10px;
background-color:black;
overflow:hidden;
}
#bigin{
margin:0 auto;
margin:10px;
padding:5px;
}
</style>
<script text="text/javascript" language="javascript">
var Px=0,Py=0;//ƹÅÒÊײ¿
var PPx,PPy;//ƹÅÒÅÄ
var Gox=10,Goy=10;
var end=false;//¹ý½ç
var isOver = false;//ÓÎÏ·½áÊø
var score = 0;//·ÖÊý
var isMove = 0;//ƹÅÒÅĿɷñÒÆ¶¯
function $(id){
return document.getElementById(id);
}
window.onload = function(){
Px = Math.round(Math.random()*33)*20;
createPingPang(Px,Py);
createPingPangPai(300,330);
AllDiv = $("box").all.tags("DIV");
AllSpan = $("box").all.tags("SPAN");
$("bigin").attachEvent('onclick',function(){
&n
Ïà¹ØÎĵµ£º
µÚÎåÕ Strings and Regular Expressions ×Ö·û´®ºÍÕýÔò±í´ïʽ
Practically all JavaScript programs are intimately tied to strings. For example, many applications use Ajax to fetch strings from a server, convert those strings into more easily usable JavaScript objects, and ......
String Trimming ×Ö·û´®ÐÞ¼ô
Removing leading and trailing whitespace from a string is a simple but common task. Although ECMAScript 5 adds a native string trim method (and you should therefore start to see this method in upcoming browsers), JavaScript has not historically in ......
Yielding with Timers Óö¨Ê±Æ÷Èóöʱ¼äƬ
Despite your best efforts, there will be times when a JavaScript task cannot be completed in 100 milliseconds or less because of its complexity. In these cases, it's ideal to yield control of the UI thread so that UI updates may occur ......
Splitting Up Tasks ·Ö½âÈÎÎñ
What we typically think of as one task can often be broken down into a series of subtasks. If a single function is taking too long to execute, check to see whether it can be broken down into a series of smaller functions that complete in smaller ......
Summary ×ܽá
When web pages or applications begin to feel slow, analyzing assets as they come over the wire and profiling scripts while they are running allows you to focus your optimization efforts where they are needed most.
µ±ÍøÒ³»òÓ¦ÓóÌÐò±äÂýʱ£¬·ÖÎ ......