查看完整版本: 泡泡滑鼠游標

24-1-2010 10:00

泡泡滑鼠游標

<P><FONT color=purple>可將下列圖檔更改,隨自己所好揀選泡泡款狀</FONT></P>
<P><FONT color=purple></FONT>&nbsp;</P>
<P><FONT color=purple>http://www.bunbunhk.com/BBS/js/bubble.png</FONT></P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P>
<P>&nbsp;</P></P>
<P><FONT color=blue>&lt;script language="JavaScript"&gt;<BR>&lt;!--<BR>Image0=new Image();<BR>Image0.src="http://www.bunbunhk.com/BBS/js/bubble.png";<BR>Amount=60; <BR>Ymouse=-30;<BR>Xmouse=-30;<BR>Ypos=new Array();<BR>Xpos=new Array();<BR>Speed=new Array();<BR>rate=new Array();<BR>grow=new Array();<BR>Step=new Array();<BR>Cstep=new Array();<BR>nsSize=new Array();<BR>ns=(document.layers)?1:0;<BR>(document.layers)?window.captureEvents(Event.MOUSEMOVE):0;<BR>function Mouse(evnt){<BR>&nbsp;Ymouse=(document.layers)?evnt.pageY-20:event.y-20;<BR>&nbsp;Xmouse=(document.layers)?evnt.pageX:event.x;<BR>}<BR>(document.layers)?window.onMouseMove=Mouse:document.onmousemove=Mouse;<BR>for (i=0; i &lt; Amount; i++){&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;Ypos[i]=Ymouse;<BR>&nbsp;Xpos[i]=Xmouse;<BR>&nbsp;Speed[i]=Math.random()*4+1;<BR>&nbsp;Cstep[i]=0;<BR>&nbsp;Step[i]=Math.random()*0.1+0.05;<BR>&nbsp;grow[i]=8;<BR>&nbsp;nsSize[i]=Math.random()*15+5;<BR>&nbsp;rate[i]=Math.random()*0.5+0.1;<BR>}<BR>if (ns){<BR>for (i = 0; i &lt; Amount; i++){<BR>document.write("&lt;LAYER NAME='sn"+i+"' LEFT=0 TOP=0&gt;&lt;img src="+Image0.src+" name='N' width="+nsSize[i]+" height="+nsSize[i]+"&gt;&lt;/LAYER&gt;");<BR>}<BR>}<BR>else{<BR>document.write('&lt;div style="position:absolute;top:0px;left:0px"&gt;&lt;div style="position:relative"&gt;');<BR>for (i = 0; i &lt; Amount; i++){<BR>document.write('&lt;img id="si" src="'+Image0.src+'" style="position:absolute;top:0px;left:0px;filter:alpha(opacity=90)"&gt;');<BR>}<BR>document.write('&lt;/div&gt;&lt;/div&gt;');<BR>}<BR>function MouseBubbles(){<BR>var hscrll=(document.layers)?window.pageYOffset:document.body.scrollTop;<BR>var wscrll=(document.layers)?window.pageXOffset:document.body.scrollLeft;<BR>for (i=0; i &lt; Amount; i++){<BR>sy = Speed[i]*Math.sin(270*Math.PI/180);<BR>sx = Speed[i]*Math.cos(Cstep[i]*4);<BR>Ypos[i]+=sy;<BR>Xpos[i]+=sx; <BR>if (Ypos[i] &lt; -40){<BR>Ypos[i]=Ymouse;<BR>Xpos[i]=Xmouse;<BR>Speed[i]=Math.random()*6+4;<BR>grow[i]=8;<BR>nsSize[i]=Math.random()*15+5;<BR>}<BR>if (ns){<BR>document.layers['sn'+i].left=Xpos[i]+wscrll;<BR>document.layers['sn'+i].top=Ypos[i]+hscrll;<BR>}<BR>else{<BR>si[i].style.pixelLeft=Xpos[i]+wscrll;<BR>si[i].style.pixelTop=Ypos[i]+hscrll;<BR>si[i].style.width=grow[i];<BR>si[i].style.height=grow[i]; <BR>}<BR>grow[i]+=rate[i]; <BR>Cstep[i]+=Step[i];<BR>if (grow[i] &gt; 24) grow[i]=25;<BR>}<BR>setTimeout('MouseBubbles()',10);<BR>}<BR>MouseBubbles();<BR>--&gt;<BR>&lt;/script&gt;</FONT></P>
<P><FONT color=#0000ff></FONT>&nbsp;</P>
<P><FONT color=#0000ff></FONT>&nbsp;</P>
<P><FONT color=#0000ff size=3></FONT>&nbsp;</P>
<P><FONT color=#0000ff size=3></FONT>&nbsp;</P>
<P><FONT color=#0000ff size=3>如不能顯示語法效果可貼去本站</FONT><A href="http://www.bunbun000.com/html/index.htm" target=_blank><FONT color=red size=3>語法測試板</FONT></A><FONT color=#0000ff size=3>試看</FONT></P>

25-5-2013 16:01

複製上列語法

<form name="copy">
<textarea cols="40" name="txt" rows="4" style="BACKGROUND-COLOR:#ffffff; COLOR:#000000; FONT-SIZE:9pt">
<script language="JavaScript">
<!--
Image0=new Image();
Image0.src="http://www.bunbunhk.com/BBS/js/bubble.png";
Amount=60;
Ymouse=-30;
Xmouse=-30;
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[i]=Ymouse;
Xpos[i]=Xmouse;
Speed[i]=Math.random()*4+1;
Cstep[i]=0;
Step[i]=Math.random()*0.1+0.05;
grow[i]=8;
nsSize[i]=Math.random()*15+5;
rate[i]=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[i]+" height="+nsSize[i]+"></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[i]*Math.sin(270*Math.PI/180);
sx = Speed[i]*Math.cos(Cstep[i]*4);
Ypos[i]+=sy;
Xpos[i]+=sx;
if (Ypos[i] < -40){
Ypos[i]=Ymouse;
Xpos[i]=Xmouse;
Speed[i]=Math.random()*6+4;
grow[i]=8;
nsSize[i]=Math.random()*15+5;
}
if (ns){
document.layers['sn'+i].left=Xpos[i]+wscrll;
document.layers['sn'+i].top=Ypos[i]+hscrll;
}
else{
si[i].style.pixelLeft=Xpos[i]+wscrll;
si[i].style.pixelTop=Ypos[i]+hscrll;
si[i].style.width=grow[i];
si[i].style.height=grow[i];
}
grow[i]+=rate[i];
Cstep[i]+=Step[i];
if (grow[i] > 24) grow[i]=25;
}
setTimeout('MouseBubbles()',10);
}
MouseBubbles();
-->
</script>
</textarea><br>
<input onclick="javascript:this.form.txt.focus();this.form.txt.select();" type="button" value="全選">
</form>

<br>

<script type="text/javascript"><!--
google_ad_client = "ca-pub-4078143172638881";
/* 336X280 */
google_ad_slot = "3268225205";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
頁: [1]
查看完整版本: 泡泡滑鼠游標