I have a question

Kiki

<Font color=red>CoMiC ReLiEf<br><font color=purple
Joined
Aug 19, 1999
Messages
1,445
I was researching stuff on hydrogen peroxide and I came across this site. http://www.h2o2-4u.com/price.html

Where ever you move your mouse, these little bubbles come up. I always wanted to know how that happens, but could never figure it out

I right mouse clicked the page and went to view source. I saw this and was wondering if this is a code you can use to get the bubbles

< !-- Begin
Image0 = new Image();
Image0.src = "image/bubl2.gif";
Amount = 20;
Ymouse = -50;
Xmouse = -50;
Ypos = new Array();
Xpos = new Array();
Speed = new Array();
rate = new Array();
grow = new Array();
Step = new Array();
Cstep = new Array();
nsSize = new Array();
ns = (document.layers)?1:0;
(document.layers) ? window.captureEvents(Event.MOUSEMOVE):0;
function Mouse(evnt) {
Ymouse=(document.layers)?evnt.pageY-20:event.y-20;
Xmouse=(document.layers)?evnt.pageX:event.x;
}
(document.layers)?window.onMouseMove=Mouse:document.onmousemove=Mouse;
for (i = 0; i < Amount; i++) {
Ypos = Ymouse;
Xpos = Xmouse;
Speed = Math.random()*4+1;
Cstep = 0;
Step = Math.random()*0.1+0.05;
grow = 8;
nsSize = Math.random()*15+5;
rate = Math.random()*0.5+0.1;
}
if (ns) {
for (i = 0; i < Amount; i++) {
document.write("<LAYER NAME='sn"+i+"' LEFT=0 TOP=0><img src="+Image0.src+" name='N' width="+nsSize+" height="+nsSize+"></LAYER>");
}
}
else {
document.write('<div style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i = 0; i < Amount; i++) {
document.write('<img id="si" src="'+Image0.src+'" style="position:absolute;top:0px;left:0px;filter:alpha(opacity=90)">');
}
document.write('</div></div>');
}
function MouseBubbles() {
var hscrll = (document.layers)?window.pageYOffset:document.body.scrollTop;
var wscrll = (document.layers)?window.pageXOffset:document.body.scrollLeft;
for (i = 0; i < Amount; i++){
sy = Speed * Math.sin(270 * Math.PI / 180);
sx = Speed * Math.cos(Cstep * 4);
Ypos += sy;
Xpos += sx;
if (Ypos < -40) {
Ypos = Ymouse;
Xpos = Xmouse;
Speed = Math.random() * 6 + 4;
grow = 8;
nsSize = Math.random() * 15 + 5;
}
if (ns) {
document.layers['sn'+i].left = Xpos + wscrll;
document.layers['sn'+i].top = Ypos + hscrll;
}
else {
si.style.pixelLeft = Xpos + wscrll;
si.style.pixelTop = Ypos + hscrll;
si.style.width = grow;
si.style.height = grow;
}
grow += rate;
Cstep += Step;
if (grow > 24) grow = 25;
}
setTimeout('MouseBubbles()', 10);
}
MouseBubbles();
// End -- >

Can anyone help me?
 
Now there's this thing up in the left corner with codes in it! Am I just confusing my self even more with that stuff?
 
I have something similar to that on some parts of my website, Kiki. It's plain html. I think they're on the snow page and on my scrapbook pages. The link is the bottom Mickey in my signature. I'd be happy to share the codes with you if you would like them. :)
 

Well, I like the snow flakes and the mickey's on your pages, Lisa, but I wanted them sort of combined. Like, Where every your mouse goes the picture falls from it. Do you get what I mean? (I know I can be confusing :) )
 
You'll need to talk to JC then, Kiki. He'll be back on Monday. :)
 
Okey Dokie! :D

Thanks for your help :)
 






New Posts









Receive up to $1,000 in Onboard Credit and a Gift Basket!
That’s right — when you book your Disney Cruise with Dreams Unlimited Travel, you’ll receive incredible shipboard credits to spend during your vacation!
CLICK HERE














DIS Facebook DIS youtube DIS Instagram DIS Pinterest DIS Tiktok DIS Twitter

Back
Top