<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>
<!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>javascript</t ......
<!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>ÎÞÏÞ¼¶Ê÷Ð ......