Jquery implements Dynamic Circle and jquery dynamic
Today, I found a good knowledge in writing plug-ins. I made a small example myself.
Copy codeThe Code is as follows:
<! Doctype html>
<Html>
<Head>
<Meta charset = "UTF-8">
<Title> untitled document </title>
<! -- Script Loading -->
<Script src = "http://libs.baidu.com/jquery/1.9.1/jquery.min.js" type = "text/javascript"> </script>
<Script type = "text/javascript">
$ (Document). ready (function (e ){
Var a = 200, B = 200, r = 90, times = 0;
SetInterval (function flutter (){
Times + = 0.1;
Var hudu = (2 * Math. PI/360) * 6 * times;
Var X = a + Math. sin (hudu) * r;
Var Y = B-Math. cos (hudu) * r // note that "-" is used here, because the obtained Y is relative to (0, 0.
// $ (". Sky_text" ).css ({"left": X + "px", "top": Y + "px "});
$ ("Body "). append ('<div style = "position: absolute; left:' + X + 'px; top: '+ Y +' px; width: 1px; height: 1px; background: # 00F; "> </div> ');
If (times = 60 ){
Return;
}
}, 2 );
});
</Script>
<Style type = "text/css">
Body, html {padding: 0; margin: 0 ;}
</Style>
</Head>
<Body>
<Div style = "position: absolute; left: 198px; top: 198px; width: 4px; height: 4px; background: # F00;"> </div>
</Body>
</Html>