Copy code code as follows:
<! Doctype HTML PUBLIC "-// W3C // DTD XHTML 1.0 Transitional // EN" http://www.w3.org/xhtml1/dtddml1-transitationAl.dtd ">
<html xmlns = "http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv = "content-type" content = "text /html; charset = utf-8" /> />
<Title> Non -Title Document </Title>
<Style>
.ld_anipic {position: absolute; width: 8px; height: 8px; background-color: #ccc;}
</style>
<script>
// LD animation formation
// Divid loaded
Function ldani (contain_id, id_flag, start_id) {
this.contain_id = contain_id;
this.id_flag = id_flag;
this.start_id = start_id;
this.a = new array ();
this.tempa = new array ();
this.add_cmd = function (cmd) {
this.a.unshift (CMD);
};
this.bakdata = function () {
this.tempa = this.a.concat ();
};
this.steprun = function () {
if (this.a.length <1) {{
// From the copy of the copy to the cache, it is used to circulate
//this.a = this.tempa.concat ();
Return;
}
var x = this.a.pop ();
var cmds = x.tostring (). split (";"); // character points
for (var I = 0; I <cmds.length; i ++) {
if (cmds [i] .tring (). 10th> 0) {{
var d = cmds [i] .tring (). split (",");
this.dit (d [0], d [1], d [2], d [3]);
}
}
};
this.dit = Function (Objid, CMD, CS1, CS2) {{
var obj = null;
try {
obj = document.GetelementByid (this.id_flag + objid);
} Catch (e) {}
// Move means moving
if (cmd == "m") {{
obj.style.left = cs1 + "px";
obj.style.top = cs2 + "px";
}
// show shows
else if (cmd == "s") {{
obj.style.display = "block";
}
// hidden hidden meaning
else if (cmd == "h") {{
obj.style.display = "None";
}
else if (cmd == "a") {{
this.start_id ++;
var atag = document.createElement ("a");
Atag.setattribute ("class", "ld_anipic");
Atag.setattribute ("ID", this.id_flag + this.start_id);
document.GetelementByid (this.contain_id) .appndchild (ata);
try {
obj = document.GetelementByid (this.id_flag + this.start_id);
} Catch (e) {}
obj.style.display = "block";
obj.style.left = cs1 + "px";
obj.style.top = cs2 + "px";
}
}
}
// Animation speed can be controlled here
var ani = new ldani ("ld_anicon", "ldanim_pic", 1);
// 7
ani.add_cmd ("1, a, 0,0");
ani.add_cmd ("1, a, 10,0");
ani.add_cmd ("1, a, 20,0");
ani.add_cmd ("1, a, 30,0");
ani.add_cmd ("1, a, 40,0");
ani.add_cmd ("1, a, 50,0");
ani.add_cmd ("1, a, 50,10");
ani.add_cmd ("1, a, 44,20");
ani.add_cmd ("1, a, 39,30");
ani.add_cmd ("1, a, 35,40");
ani.add_cmd ("1, a, 31,50");
ani.add_cmd ("1, a, 29,60");
ani.add_cmd ("1, a, 27,70");
ani.add_cmd ("1, a, 25,80");
ani.add_cmd ("1, a, 23,90");
ani.add_cmd ("1, a, 22,100");
ani.add_cmd ("1, a, 21,110");
// 5
ani.add_cmd ("1, a, 70,0");
ani.add_cmd ("1, a, 70,10");
ani.add_cmd ("1, a, 70,20");
ani.add_cmd ("1, a, 70,30");
ani.add_cmd ("1, a, 70,40");
ani.add_cmd ("1, a, 84,45");
ani.add_cmd ("1, a, 96,50");
ani.add_cmd ("1, a, 106,55");
ani.add_cmd ("1, a, 114,60");
ani.add_cmd ("1, a, 120,65");
ani.add_cmd ("1, a, 120,70");
ani.add_cmd ("1, a, 120,75");
ani.add_cmd ("1, a, 120,80");
ani.add_cmd ("1, a, 120,85");
ani.add_cmd ("1, a, 120,90");
ani.add_cmd ("1, a, 114,95");
ani.add_cmd ("1, a, 106,100");
ani.add_cmd ("1, a, 96,105");
ani.add_cmd ("1, a, 84,110");
ani.add_cmd ("1, a, 70,110");
ani.add_cmd ("1, a, 80,20");
ani.add_cmd ("1, a, 90,20");
ani.add_cmd ("1, a, 100,20");
ani.add_cmd ("1, a, 110,20");
ani.add_cmd ("1, a, 120,20");
ani.bakdata ();
setInterval ("ANI.StePrun ()", 50); 50); 50); 50);
</script>
</head>
<body>
<div> Use JS to move some pictures to form an animation effect </div>
<Table>
<tr>
<td ID = "ld_anicon" style = "position: related: display: inline-block; width: 160px;">
</td>
<td style = "display: inline-block; font-size: 250px;">
Soft.com
</td>
</tr>
</table>
</body>
</html>