查看完整版本: 圖片飄遊特效

11-6-2012 18:00

圖片飄遊特效

<P><FONT color=purple>http://bunbun000.com/home/index/bunlogo2.gif &lt;&lt;&lt; 圖檔網址,可更改</FONT><BR><FONT color=purple></FONT><BR><FONT color=purple>width=88 height=31 &lt;&lt;&lt;圖檔原大,必須跟圖更改,共有兩處</FONT></P>
<P><FONT color=#800080></FONT>&nbsp;</P>
<P><FONT color=#800080></FONT>&nbsp;</P>
<P><FONT color=#800080></FONT>&nbsp;</P>
<P><FONT color=#800080></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>
<P><BR><FONT color=blue></FONT><BR><FONT color=blue></FONT><BR><FONT color=blue></FONT><BR><FONT color=blue>&lt;SCRIPT language="JavaScript1.2"&gt;</FONT><BR><FONT color=blue><BR>var cursorpath="</FONT><FONT color=blue>http://bunbun000.com/home/index/bunlogo2.gif</FONT><FONT color=blue>"</FONT><BR><FONT color=blue>if (document.layers)<BR>{document.write("&lt;LAYER NAME='PoInTeRs' LEFT=10 TOP=10&gt;&lt;img src='"+cursorpath+"' width=88 height=31&gt;&lt;/LAYER&gt;")}<BR>else if (document.all){document.write("&lt;div id='pOiNtErS' style='position:absolute;top:10px;left:10px;width:17px;height:22px;z-index:50'&gt;&lt;img src='"+cursorpath+"' width=88 height=31&gt;&lt;/div&gt;")}</FONT><BR><FONT color=blue>count=-1; <BR>move=1;</FONT><BR><FONT color=blue>function Curve(){<BR>abc=new Array(0,1,1,1,2,3,4,0,6,-1,-1,-1,-2,-3,-4,0,-6)<BR>for (i=0; i &lt; abc.length; i++)<BR>{var C=Math.round(Math.random()*[i])}<BR>howbend=abc[C];<BR>setTimeout('Curve()',1900);<BR>return howbend;<BR>}<BR>ypos=10;<BR>xpos=10;</FONT></P>
<P><FONT color=blue>degree = 60;<BR>function MoveRandom(){<BR>PathBend=degree+=howbend;//ok!<BR>y = 4*Math.sin(PathBend*Math.PI/180);<BR>x = 6*Math.cos(PathBend*Math.PI/180);<BR>if (document.layers){<BR>ypos+=y;<BR>xpos+=x;<BR>document.PoInTeRs.top=ypos+window.pageYOffset;<BR>document.PoInTeRs.left=xpos+window.pageXOffset;<BR>}<BR>else if (document.all){<BR>ypos+=y;<BR>xpos+=x;<BR>document.all.pOiNtErS.style.top=ypos+document.body.scrollTop;<BR>document.all.pOiNtErS.style.left=xpos+document.body.scrollLeft;<BR>}<BR>T=setTimeout('MoveRandom()',50);<BR>}<BR>function edges(){<BR>if (document.layers){<BR>if (document.PoInTeRs.left &gt;= window.innerWidth-40+window.pageXOffset)degree=Math.round(Math.random()*45+157.5);<BR>if (document.PoInTeRs.top &gt;= window.innerHeight-30+window.pageYOffset)degree=Math.round(Math.random()*45-112.5);<BR>if (document.PoInTeRs.top &lt;= 2+window.pageYOffset) degree = Math.round(Math.random()*45+67.5);//OK!<BR>if (document.PoInTeRs.left &lt;= 2+window.pageXOffset) degree = Math.round(Math.random()*45-22.5);//OK!<BR>}<BR>else if (document.all)<BR>{<BR>if (document.all.pOiNtErS.style.pixelLeft &gt;= document.body.offsetWidth-45+document.body.scrollLeft)degree=Math.round(Math.random()*45+157.5);<BR>if (document.all.pOiNtErS.style.pixelTop &gt;= document.body.offsetHeight-35+document.body.scrollTop)degree=Math.round(Math.random()*45-112.5);<BR>if (document.all.pOiNtErS.style.pixelTop &lt;= 2+document.body.scrollTop) degree = Math.round(Math.random()*45+67.5);//OK!<BR>if (document.all.pOiNtErS.style.pixelLeft &lt;= 2+document.body.scrollLeft) degree = Math.round(Math.random()*45-22.5);//OK!<BR>}<BR>setTimeout('edges()',100);<BR>}<BR>function starteffect(){<BR>Curve();<BR>MoveRandom();// onUnload="opener.gO()"<BR>edges();<BR>}</FONT></P>
<P><FONT color=blue>if (document.all||document.layers)<BR>window.onload=starteffect<BR>&lt;/script&gt;<BR></FONT></P>



<SCRIPT language="JavaScript1.2">

var cursorpath="http://bunbun000.com/home/index/bunlogo2.gif"
if (document.layers)
{document.write("<LAYER NAME='PoInTeRs' LEFT=10 TOP=10><img src='"+cursorpath+"' width=88 height=31></LAYER>")}
else if (document.all){document.write("<div id='pOiNtErS' style='position:absolute;top:10px;left:10px;width:17px;height:22px;z-index:50'><img src='"+cursorpath+"' width=88 height=31></div>")}
count=-1;
move=1;
function Curve(){
abc=new Array(0,1,1,1,2,3,4,0,6,-1,-1,-1,-2,-3,-4,0,-6)
for (i=0; i < abc.length; i++)
{var C=Math.round(Math.random()*[i])}
howbend=abc[C];
setTimeout('Curve()',1900);
return howbend;
}
ypos=10;
xpos=10;

degree = 60;
function MoveRandom(){
PathBend=degree+=howbend;//ok!
y = 4*Math.sin(PathBend*Math.PI/180);
x = 6*Math.cos(PathBend*Math.PI/180);
if (document.layers){
ypos+=y;
xpos+=x;
document.PoInTeRs.top=ypos+window.pageYOffset;
document.PoInTeRs.left=xpos+window.pageXOffset;
}
else if (document.all){
ypos+=y;
xpos+=x;
document.all.pOiNtErS.style.top=ypos+document.body.scrollTop;
document.all.pOiNtErS.style.left=xpos+document.body.scrollLeft;
}
T=setTimeout('MoveRandom()',50);
}
function edges(){
if (document.layers){
if (document.PoInTeRs.left >= window.innerWidth-40+window.pageXOffset)degree=Math.round(Math.random()*45+157.5);
if (document.PoInTeRs.top >= window.innerHeight-30+window.pageYOffset)degree=Math.round(Math.random()*45-112.5);
if (document.PoInTeRs.top <= 2+window.pageYOffset) degree = Math.round(Math.random()*45+67.5);//OK!
if (document.PoInTeRs.left <= 2+window.pageXOffset) degree = Math.round(Math.random()*45-22.5);//OK!
}
else if (document.all)
{
if (document.all.pOiNtErS.style.pixelLeft >= document.body.offsetWidth-45+document.body.scrollLeft)degree=Math.round(Math.random()*45+157.5);
if (document.all.pOiNtErS.style.pixelTop >= document.body.offsetHeight-35+document.body.scrollTop)degree=Math.round(Math.random()*45-112.5);
if (document.all.pOiNtErS.style.pixelTop <= 2+document.body.scrollTop) degree = Math.round(Math.random()*45+67.5);//OK!
if (document.all.pOiNtErS.style.pixelLeft <= 2+document.body.scrollLeft) degree = Math.round(Math.random()*45-22.5);//OK!
}
setTimeout('edges()',100);
}
function starteffect(){
Curve();
MoveRandom();// onUnload="opener.gO()"
edges();
}

if (document.all||document.layers)
window.onload=starteffect
</script>

25-5-2013 11:45

複製上列語法

<form name="copy">
<textarea cols="40" name="txt" rows="4" style="BACKGROUND-COLOR:#ffffff; COLOR:#000000; FONT-SIZE:9pt">
<SCRIPT language="JavaScript1.2">

var cursorpath="http://bunbun000.com/home/index/bunlogo2.gif"
if (document.layers)
{document.write("<LAYER NAME='PoInTeRs' LEFT=10 TOP=10><img src='"+cursorpath+"' width=88 height=31></LAYER>")}
else if (document.all){document.write("<div id='pOiNtErS' style='position:absolute;top:10px;left:10px;width:17px;height:22px;z-index:50'><img src='"+cursorpath+"' width=88 height=31></div>")}
count=-1;
move=1;
function Curve(){
abc=new Array(0,1,1,1,2,3,4,0,6,-1,-1,-1,-2,-3,-4,0,-6)
for (i=0; i < abc.length; i++)
{var C=Math.round(Math.random()*[i])}
howbend=abc[C];
setTimeout('Curve()',1900);
return howbend;
}
ypos=10;
xpos=10;

degree = 60;
function MoveRandom(){
PathBend=degree+=howbend;//ok!
y = 4*Math.sin(PathBend*Math.PI/180);
x = 6*Math.cos(PathBend*Math.PI/180);
if (document.layers){
ypos+=y;
xpos+=x;
document.PoInTeRs.top=ypos+window.pageYOffset;
document.PoInTeRs.left=xpos+window.pageXOffset;
}
else if (document.all){
ypos+=y;
xpos+=x;
document.all.pOiNtErS.style.top=ypos+document.body.scrollTop;
document.all.pOiNtErS.style.left=xpos+document.body.scrollLeft;
}
T=setTimeout('MoveRandom()',50);
}
function edges(){
if (document.layers){
if (document.PoInTeRs.left >= window.innerWidth-40+window.pageXOffset)degree=Math.round(Math.random()*45+157.5);
if (document.PoInTeRs.top >= window.innerHeight-30+window.pageYOffset)degree=Math.round(Math.random()*45-112.5);
if (document.PoInTeRs.top <= 2+window.pageYOffset) degree = Math.round(Math.random()*45+67.5);//OK!
if (document.PoInTeRs.left <= 2+window.pageXOffset) degree = Math.round(Math.random()*45-22.5);//OK!
}
else if (document.all)
{
if (document.all.pOiNtErS.style.pixelLeft >= document.body.offsetWidth-45+document.body.scrollLeft)degree=Math.round(Math.random()*45+157.5);
if (document.all.pOiNtErS.style.pixelTop >= document.body.offsetHeight-35+document.body.scrollTop)degree=Math.round(Math.random()*45-112.5);
if (document.all.pOiNtErS.style.pixelTop <= 2+document.body.scrollTop) degree = Math.round(Math.random()*45+67.5);//OK!
if (document.all.pOiNtErS.style.pixelLeft <= 2+document.body.scrollLeft) degree = Math.round(Math.random()*45-22.5);//OK!
}
setTimeout('edges()',100);
}
function starteffect(){
Curve();
MoveRandom();// onUnload="opener.gO()"
edges();
}

if (document.all||document.layers)
window.onload=starteffect
</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]
查看完整版本: 圖片飄遊特效