The example in this article describes the method by which JavaScript enables the generation of bubbles at the point where the mouse is sliding. Share to everyone for your reference. The implementation method is as follows:
<HTML> <HEAD> <title> Mouse around the page generates Bubbles </title> </HEAD> <body bgcolor= #000000 scroll=no Onload=zyva () > <div id=aqua style= "position:absolute;left=0;top=0;" ></div> <SCRIPT> object = new Array () var xm,ym function CObj (n,obj) {aqua.insertadjacenthtml ("Afterbegin", " ') this.img = Aqua.firstChild.style Mr = Math.random () this.v = 6*mr+4 THIS.S =. 5*mr THIS.P =. 1+mr THIS.W = 0 this. K = 0 This.x = XM This.y = N this. Chteumeuleu = function Chteumeuleu () {with (this) {with (img) {left = (X+=0.5*v*math.sin (k+=s))-w*0.5 top = y-=v width = Mat H.min (W+=P,100)} if (y<-w) {w = 8 y = ym x = xm}}} function gradient (r,g,b,m) {for (i=0;i<25;i++) {c = 255-10 * I C = "\" RGB ("+math.round (c*r/255) +", "+math.round (c*g/255) +", "+math.round (c*b/255) +") \ "" Code = "<span style=" Position:absolute;font-size:1pt;left=0;width=120%;height= "+ (m) + ". 2%;top=" + (i*m) + "%;background=" +c+ "z-index:-1000 ' ></span>" Document.body.insertAdjacentHTML (" BeforeEnd ", Code)}} function Zyva () {XM = document.body.offsetWidth * 0.5 ym = Document.body.offsetHeight document.onmous emove = function () {XM = Window.event.clientX ym = Window.event.clientY} for (i=0;i<60;i++) object[i] = new CObj (i,b) s Etinterval ("for" (I-Object) Object[i]. Chteumeuleu () "," Gradient (41,93,214,2)} </SCRIPT> </BODY> </HTML>
The
wants this article to help you with your JavaScript programming.