JavaScript realizes the method of generating bubbles in the mouse over the _javascript technique

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.