音乐堡音乐论坛's Archiver

corea 发表于 2008-4-10 01:01

鼠标特效(更新中)

[table=100%,#FFFFE6][tr][td][size=9pt][发帖际遇]: [url=http://www.yule.co.nz/bbs/event.php]corea在五星级酒店和MM HAPPY一晚, 花费堡币65元.[/url][/font][/td][/tr][/table]

<P>1、怎样使用特效代码?<BR>&nbsp;&nbsp;&nbsp;&nbsp;只要把这些代码复制、粘贴到你的网页源代码中,保存,再在浏览器中打开,你就会看到效果了!<BR></P>
<P>&nbsp;</P>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<P>2、怎样在我的网页中插入代码?<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;使用DreamWeaver:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 在编辑状态下按F10即弹出源代码窗口,将特效代码粘贴进去即可。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 使用FrontPage:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 点击编辑窗口左下角的“HTML”选项卡即出现源代码窗口,将特效代码粘贴进去即可。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 使用“记事本”等编辑器:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 直接用这些编辑器打开网页文件,出现的就是源代码,将特效代码粘贴进去即可。&nbsp;<BR>&nbsp;<BR>3、在什么地方插入代码?<BR>&nbsp;&nbsp;&nbsp; 一般来说,在网页源代码的&lt;body&gt;与&lt;/body&gt;之间的任何地方插入代码都可以(除非特别指明,例如要求插入到&lt;head&gt;与&lt;/head&gt;之间)。</P></BLOCKQUOTE></BLOCKQUOTE>
<P>&nbsp;&nbsp;&nbsp; 提示:在&lt;td&gt;与&lt;/td&gt;之间插入代码,一般不会出错。<BR></P>
<P>&nbsp;</P>
<P>4、该怎样修改代码?<BR>&nbsp;&nbsp;&nbsp; 插入代码之后,把代码中的文字替换成你自己的内容即可。<BR>&nbsp;&nbsp;&nbsp; 注意:为避免出错,请不要改动除中文文字之外的代码,否则程序可能会不能运行! </P>

corea 发表于 2008-4-10 01:03

[color=Blue][b][size=3]效果1、跟随鼠标的文字[/size][/b][/color]<br>


<IFRAME style="WIDTH: 704px; HEIGHT: 400px" marginWidth=0 marginHeight=0 src="http://www.yybyy.com/bbsftp/vipuser/corea/effect/mouse/001.txt" frameBorder=0 width=200 scrolling=no height=400></iframe>

corea 发表于 2008-4-10 01:08

[table=100%,#FFFFE6][tr][td][size=9pt][发帖际遇]: [url=http://www.yule.co.nz/bbs/event.php]corea在馒头店卖馒头赚到堡币5元.[/url][/font][/td][/tr][/table]

<P>&lt;script language="JavaScript"&gt;</P>
<P>&nbsp;</P>
<P>&nbsp;yourLogo='享受音乐.音乐堡奉献.'; </P>
<P>logoFont='Arial'; </P>
<P>logoSize=8; </P>
<P>logoColor='c7c5d2'; </P>
<P>logoWidth=40;</P>
<P>&nbsp;logoHeight=40;</P>
<P>&nbsp;logoSpeed=0.02; </P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P>//Nothing needs altering below! </P>
<P>yourLogo=yourLogo.split('');</P>
<P>&nbsp;L=yourLogo.length; </P>
<P>Result="&lt;font face="+logoFont+" style='font-size:"+logoSize+"pt'color="+logoColor+"&gt;"; </P>
<P>TrigSplit=360/L; </P>
<P>br=(document.layers)?1:0;</P>
<P>&nbsp;if (br){ </P>
<P>for (i=0; i &lt; L; i++) </P>
<P>document.write('&lt;layer name="ns'+i+'" top=0 left=0 width=14 height=14"&gt;'+Result+yourLogo[i]+'&lt;/font&gt;&lt;/layer&gt;'); </P>
<P>} </P>
<P>else{ </P>
<P>document.write('&lt;div id="outer" style="position:absolute;top:0px;left:0px"&gt;&lt;div style="position:relative"&gt;');</P>
<P>&nbsp;for (i=0; i &lt; L; i++) </P>
<P>document.write('&lt;div id="ie" style="position:absolute;top:0px;left:0px;width:14px;height:14px"&gt;'+Result+yourLogo[i]+'&lt;/font&gt;&lt;/div&gt;'); </P>
<P>document.write('&lt;/div&gt;&lt;/div&gt;'); </P>
<P>} </P>
<P>ypos=0; </P>
<P>xpos=0; </P>
<P>step=logoSpeed; </P>
<P>currStep=0; </P>
<P>Y=new Array(); </P>
<P>X=new Array(); </P>
<P>Yn=new Array(); </P>
<P>Xn=new Array(); </P>
<P>for (i=0; i &lt; L; i++) </P>
<P>{ </P>
<P>Yn[i]=0; </P>
<P>Xn[i]=0; </P>
<P>} </P>
<P>(document.layers)?window.captureEvents(Event.MOUSEMOVE):0; </P>
<P>function Mouse(evnt){ </P>
<P>ypos = (document.layers)?evnt.pageY:event.y; </P>
<P>xpos = (document.layers)?evnt.pageX:event.x; </P>
<P>} </P>
<P>(document.layers)?window.onMouseMove=Mouse:document.onmousemove=Mouse; </P>
<P>function animateLogo(){ </P>
<P>if (!br)outer.style.pixelTop=document.body.scrollTop; </P>
<P>for (i=0; i &lt; L; i++){ </P>
<P>var layer=(document.layers)?document.layers['ns'+i]:ie[i].style; </P>
<P>layer.top =Y[i]+logoHeight*Math.sin(currStep+i*TrigSplit*Math.PI/180); </P>
<P>layer.left=X[i]+logoWidth*Math.cos(currStep+i*TrigSplit*Math.PI/180); </P>
<P>} </P>
<P>currStep-=step; </P>
<P>} </P>
<P>function Delay(){ </P>
<P>for (i=L; i &gt;= 0; i--) </P>
<P>{ </P>
<P>Y[i]=Yn[i]+=(ypos-Yn[i])*(0.1+i/L); </P>
<P>X[i]=Xn[i]+=(xpos-Xn[i])*(0.1+i/L); </P>
<P>} </P>
<P>animateLogo(); </P>
<P>setTimeout('Delay()',20); </P>
<P>} </P>
<P>window.onload=Delay;</P>
<P>&nbsp;// --&gt; </P>
<P>&lt;/script&gt;[/code]</P>
<P>&nbsp;</P>
<P>说明: </P>
<P>yourLogo='享受音乐.音乐保奉献.'; 文字内容 </P>
<P>logoFont='Arial'; 字体 </P>
<P>logoSize=8; 字号</P>
<P>&nbsp;logoColor='c7c5d2'; 颜色 </P>
<P>logoWidth=40; LOGO宽度 </P>
<P>logoHeight=40; LOGO高度</P>
<P>&nbsp;logoSpeed=0.02; LOGO速度</P>

[[i] 本帖最后由 corea 于 2008-4-10 01:24 编辑 [/i]]

corea 发表于 2008-4-10 10:43

[table=100%,#FFFFE6][tr][td][size=9pt][发帖际遇]: [url=http://www.yule.co.nz/bbs/event.php]corea收取租客本月房租堡币31元.[/url][/font][/td][/tr][/table]

[color=Blue][b][size=3]效果2、跟随鼠标的文字[/size][/b][/color]<br>


<IFRAME style="WIDTH: 704px; HEIGHT: 400px" marginWidth=0 marginHeight=0 src="http://www.yybyy.com/bbsftp/vipuser/corea/effect/mouse/002.txt" frameBorder=0 width=200 scrolling=no height=400></iframe>

corea 发表于 2008-4-10 10:52

[table=100%,#FFFFE6][tr][td][size=9pt][发帖际遇]: [url=http://www.yule.co.nz/bbs/event.php]corea买了一个馒头吃, 花了堡币5元.[/url][/font][/td][/tr][/table]

<P>将下列代码插入html文件的&lt;body&gt;和&lt;/body&gt;之间:</P>
<P><BR>&lt;SCRIPT LANGUAGE="JavaScript"&gt; </P>
<P>if (document.all) </P>
<P>{ </P>
<P>yourLogo = "音乐堡音乐论坛欢迎您!"; </P>
<P>logoFont = "宋体"; </P>
<P>logoColor = "6699ff"; </P>
<P>yourLogo = yourLogo.split(''); </P>
<P>L = yourLogo.length; </P>
<P>TrigSplit = 360 / L; </P>
<P>Sz = new Array() logoWidth = 100; </P>
<P>logoHeight = -30; </P>
<P>ypos = 0; </P>
<P>xpos = 0; </P>
<P>step = 0.03; </P>
<P>currStep = 0; </P>
<P>document.write('&lt;div id="outer" style="position:absolute;top:0px;left:0px"&gt;&lt;div style="position:relative"&gt;'); </P>
<P>for (i = 0; i &lt; L; i++) { </P>
<P>document.write('&lt;div id="ie" style="position:absolute;top:0px;left:0px;' +'width:10px;height:10px;font-family:'+logoFont+';font-size:12px;' +'color:'+logoColor+';text-align:center"&gt;'+yourLogo[i]+'&lt;/div&gt;'); </P>
<P>} </P>
<P>document.write('&lt;/div&gt;&lt;/div&gt;'); </P>
<P>function Mouse() </P>
<P>{ </P>
<P>ypos = event.y; </P>
<P>xpos = event.x - 5; </P>
<P>} </P>
<P>document.onmousemove=Mouse; </P>
<P>function animateLogo() </P>
<P>{ </P>
<P>outer.style.pixelTop = document.body.scrollTop; </P>
<P>for (i = 0; i &lt; L; i++) </P>
<P>{</P>
<P>&nbsp;ie[i].style.top = ypos + logoHeight * Math.sin(currStep + i * TrigSplit * Math.PI / 180); </P>
<P>ie[i].style.left = xpos + logoWidth * Math.cos(currStep + i * TrigSplit * Math.PI / 180); </P>
<P>Sz[i] = ie[i].style.pixelTop - ypos; </P>
<P>if (Sz[i] &lt; 5) Sz[i] = 5; </P>
<P>ie[i].style.fontSize = Sz[i] / 1.7; </P>
<P>} </P>
<P>currStep -= step; </P>
<P>setTimeout('animateLogo()', 20); </P>
<P>} </P>
<P>window.onload = animateLogo; </P>
<P>} </P>
<P>&lt;/script&gt;<BR><BR>说明:<BR>yourLogo = "音乐堡音乐论坛欢迎你"; 改为你的文字<BR>logoFont = "宋体"; 字体设置<BR>logoColor = "6699ff"; 文字颜色设置<BR></P>

corea 发表于 2008-4-10 10:54

[color=Blue][b][size=3]效果3、跟随鼠标的文字[/size][/b][/color]<br>


<IFRAME style="WIDTH: 704px; HEIGHT: 400px" marginWidth=0 marginHeight=0 src="http://www.yybyy.com/bbsftp/vipuser/corea/effect/mouse/003.txt" frameBorder=0 width=200 scrolling=no height=400></iframe>

闲云孤鹤 发表于 2008-4-11 12:15

很详细,感谢corea!

豆苗 发表于 2008-4-14 22:01

:4a46b55d020017g0 好象满好玩的~带回实验田去研究下的说

corea 发表于 2008-4-28 08:57

效果3代码:<br>以下代码加入html文件的<*body>与<*/body>之间即可<br>[code]<style type="text/css">
.spanstyle {
position:absolute;
visibility:visible;
top:-50px;
font-size:9pt;
color: #000000;
font-weight:bold;
}</style>
<script>
var x,y
var step=20
var flag=0
var message="音乐堡论坛---特别奉献."
message=message.split("")
var xpos=new Array()
for (i=0;i<=message.length-1;i++) {
xpos[i]=-50}
var ypos=new Array()
for (i=0;i<=message.length-1;i++) {
ypos[i]=-50}
function handlerMM(e){
x = (document.layers) ? e.pageX : document.body.scrollLeft+event.clientX
y = (document.layers) ? e.pageY : document.body.scrollTop+event.clientY
flag=1}
function makesnake() {
if (flag==1 && document.all) {
for (i=message.length-1; i>=1; i--) {
xpos[i]=xpos[i-1]+step
ypos[i]=ypos[i-1]       }
xpos[0]=x+step
ypos[0]=y
for (i=0; i<message.length-1; i++) {
var thisspan = eval("span"+(i)+".style")
thisspan.posLeft=xpos[i]
thisspan.posTop=ypos[i]     }   }
else if (flag==1 && document.layers) {
for (i=message.length-1; i>=1; i--) {
xpos[i]=xpos[i-1]+step
ypos[i]=ypos[i-1]       }
xpos[0]=x+step
ypos[0]=y
for (i=0; i<message.length-1; i++) {
var thisspan = eval("document.span"+i)
thisspan.left=xpos[i]
thisspan.top=ypos[i]}   }
var timer=setTimeout("makesnake()",30)}
</script>
<body onLoad="makesnake()" >
<script>
for (i=0;i<=message.length-1;i++) {
document.write("<span id='span"+i+"'class='spanstyle'>")
document.write(message[i])
document.write("</span>")}
if (document.layers){
document.captureEvents(Event.MOUSEMOVE);}
document.onmousemove = handlerMM;
</script>[/code]

[[i] 本帖最后由 corea 于 2008-4-28 09:07 编辑 [/i]]

corea 发表于 2008-4-28 09:02

[color=Blue][b][size=3]效果4、跟随鼠标的文字[/size][/b][/color]<br>


<IFRAME style="WIDTH: 704px; HEIGHT: 200px" marginWidth=0 marginHeight=0 src="http://www.yybyy.com/bbsftp/vipuser/corea/effect/mouse/004.txt" frameBorder=0 width=200 scrolling=no height=200></iframe>

corea 发表于 2008-4-28 09:05

以下代码插入html文件的<body>与</body>之间即可<br>[code]<script language="JavaScript1.2">
var scroller_msg='音乐堡欢迎你www.yybyy.com'
var dismissafter=0

var initialvisible=0
if (document.all)
document.write('<marquee id="curscroll" style="position:absolute;width:150px;border:0px solid black;font-size:14px;background-color:#ffffff;visibility:hidden">'+scroller_msg+'</marquee>')

function followcursor(){
//move cursor function for IE

if (initialvisible==0){
curscroll.style.visibility="visible"
initialvisible=1
}

curscroll.style.left=document.body.scrollLeft+event.clientX+10
curscroll.style.top=document.body.scrollTop+event.clientY+10
}

function dismissmessage(){
curscroll.style.visibility="hidden"
}


if (document.all){
document.onmousemove=followcursor
document.ondblclick=dismissmessage
if (dismissafter!=0)
setTimeout("dismissmessage()",dismissafter*1000)
}

//-->

</script>[/code]

corea 发表于 2008-4-28 09:10

[color=Blue][b][size=3]效果5、跟随鼠标的文字[/size][/b][/color]<br>


<IFRAME style="WIDTH: 704px; HEIGHT: 200px" marginWidth=0 marginHeight=0 src="http://www.yybyy.com/bbsftp/vipuser/corea/effect/mouse/005.txt" frameBorder=0 width=200 scrolling=no height=200></iframe>

corea 发表于 2008-4-28 09:11

[code]<!--将以下代码加入HTML的<Body></Body>之间-->
<script language="JavaScript1.2">
var message='教程学堂'
var messagecolor='FF0000'
var dismissafter=0
var amount=5,ypos=0,xpos=0,Ay=0,Ax=0,By=0,Bx=0,Cy=0,Cx=0,Dy=0,Dx=0,Ey=0,Ex=0;
if (document.layers){
for (i = 0; i < amount; i++)
{document.write('<layer name=ns'+i+' top=0 left=0><font face="宋体" size=2 color='+messagecolor+'>'+message+'</font></layer>')}
window.captureEvents(Event.MOUSEMOVE);
function nsmouse(evnt){xpos = evnt.pageX;ypos = evnt.pageY;makefollow()}
}
else if (document.all){
document.write("<div id='outer' style='position:absolute;top:0px;left:0px'>");
document.write("<div id='inner' style='position:relative'>");
for (i = 0; i < amount; i++)
{document.write('<div id="text"'+i+' style="position:absolute;top:0px;left:0px;font-family:Courier New;font-size:16px;color:'+messagecolor+'">'+message+'</div>')}
document.write("</div>");
document.write("</div>");
function iemouse(){ypos = document.body.scrollTop + event.y;xpos = document.body.scrollLeft + event.x;makefollow()}
}
function makefollow(){
if (document.layers){
document.layers["ns0"].top=ay;document.layers["ns0"].left=ax;
document.layers["ns1"].top=by;document.layers["ns1"].left=bx;
document.layers["ns2"].top=cy;document.layers["ns2"].left=cx;
document.layers["ns3"].top=Dy;document.layers["ns3"].left=Dx;
document.layers["ns4"].top=Ey;document.layers["ns4"].left=Ex;
}
else if (document.all){
outer.all.inner.all[0].style.pixelTop=ay;outer.all.inner.all[0].style.pixelLeft=ax;
outer.all.inner.all[1].style.pixelTop=by;outer.all.inner.all[1].style.pixelLeft=bx;
outer.all.inner.all[2].style.pixelTop=cy;outer.all.inner.all[2].style.pixelLeft=cx;
outer.all.inner.all[3].style.pixelTop=Dy;outer.all.inner.all[3].style.pixelLeft=Dx;
outer.all.inner.all[4].style.pixelTop=Ey;outer.all.inner.all[4].style.pixelLeft=Ex;
}
}
function move(){
if (dismissafter!=0)
setTimeout("hidetrail()",dismissafter*1000)

if (document.layers){window.onMouseMove = nsmouse}
else if (document.all){window.document.onmousemove = iemouse}
ey = Math.round(Ey+=((ypos+20)-Ey)*2/2);ex = Math.round(Ex+=((xpos+20)-Ex)*2/2);
dy = Math.round(Dy+=(ey - Dy)*2/4);dx = Math.round(Dx+=(ex - Dx)*2/4);
cy = Math.round(Cy+=(dy - Cy)*2/6);cx = Math.round(Cx+=(dx - Cx)*2/6);
by = Math.round(By+=(cy - By)*2/8);bx = Math.round(Bx+=(cx - Bx)*2/8);
ay = Math.round(Ay+= (by - Ay)*2/10);ax = Math.round(Ax+= (bx - Ax)*2/10);
makefollow();
jumpstart=setTimeout('move()',10);
}

function hidetrail(){
if (document.all){
for (i2=0;i2<amount;i2++){
outer.all.inner.all[i2].style.visibility="hidden"
clearTimeout(jumpstart)
}
}
else if (document.layers){
for (i2=0;i2<amount;i2++){
temp="ns"+i2
document.layers[temp].visibility="hide"
clearTimeout(jumpstart)
}
}
}

window.onload=move;
//-->
</script>




</body>

</html>[/code]

Sergin 发表于 2008-9-30 16:16

学习学习
今天是html学习日~:4a46b55d020017ev

页: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.