JS特效.docx

上传人:b****5 文档编号:6400658 上传时间:2023-01-06 格式:DOCX 页数:42 大小:28.51KB
下载 相关 举报
JS特效.docx_第1页
第1页 / 共42页
JS特效.docx_第2页
第2页 / 共42页
JS特效.docx_第3页
第3页 / 共42页
JS特效.docx_第4页
第4页 / 共42页
JS特效.docx_第5页
第5页 / 共42页
点击查看更多>>
下载资源
资源描述

JS特效.docx

《JS特效.docx》由会员分享,可在线阅读,更多相关《JS特效.docx(42页珍藏版)》请在冰豆网上搜索。

JS特效.docx

JS特效

这都包括文字,菜单,背影,鼠标,图像,等特效~全部是JS类型的,粘过去就可以用@!

逐隐逐现的文字特效

1、以下代码放在一个新建页面的HTML的区即可:

[页面上必须什么都没有]

特效 

--//

varthissize=20

vartextfont="隶书"

vartextcolor=newArray()

textcolor[0]="000000"

textcolor[1]="000000"

textcolor[2]="000000"

textcolor[3]="111111"

textcolor[4]="222222"

textcolor[5]="333333"

textcolor[6]="444444"

textcolor[7]="555555"

textcolor[8]="666666"

textcolor[9]="777777"

textcolor[10]="888888"

textcolor[11]="999999"

textcolor[12]="aaaaaa"

textcolor[13]="bbbbbb"

textcolor[14]="cccccc"

textcolor[15]="dddddd"

textcolor[16]="eeeeee"

textcolor[17]="ffffff"

textcolor[18]="ffffff"

varmessage=newArray()

message[0]=""

message[1]="HappyDrips工作室"

message[2]="谢谢您使用"

message[3]="javascript源码大全"

i_message=0

vari_strength=0

vari_message=0

vartimer

functionglowtext(){ 

if(document.all){

if(i_strength<=17){

glowdiv.innerText=message[i_message]

document.all.glowdiv.style.filter="glow(color="+textcolor[i_strength]+",strength=4)"

i_strength++

timer=setTimeout("glowtext()",100)

}

else{

clearTimeout(timer)

setTimeout("deglowtext()",1500)

}

}

}functiondeglowtext(){ 

if(document.all){

if(i_strength>=0){

glowdiv.innerText=message[i_message]

document.all.glowdiv.style.filter="glow(color="+textcolor[i_strength]+",strength=4)"

i_strength--

timer=setTimeout("deglowtext()",100)

}

else{

clearTimeout(timer)

i_message++

if(i_message>=message.length){i_message=0}

i_strength=0

intermezzo()

}

}

}

functionintermezzo(){ 

glowdiv.innerText=""

setTimeout("glowtext()",1500) 

}

//-->

//不要忘记写 

absolute;visibility:

visible;width:

600px;text-align:

center; 

top:

150px;left:

50px;font-family:

隶书;font-size:

30pt;color:

000000">

====2、[可选项]修改

标签内的代码可以确定文字显示的位置,颜色和大小。

top是距离屏幕上面的距离,left是距离坐侧的距离。

font-size是文字大小,

color是颜色。

width是DIV层的宽度。

由于文字是用DIV来控制的,所以在DIV的宽度范围内不能有其它内容。

DIV的位置用绝对位置(position:

absolute)表示

====1、以下代码放在一个新建页面的HTML的区即可:

[页面上必须什么都没有]

特效 

--//

varthissize=20

vartextfont="隶书"

vartextcolor=newArray()

textcolor[0]="000000"

textcolor[1]="000000"

textcolor[2]="000000"

textcolor[3]="111111"

textcolor[4]="222222"

textcolor[5]="333333"

textcolor[6]="444444"

textcolor[7]="555555"

textcolor[8]="666666"

textcolor[9]="777777"

textcolor[10]="888888"

textcolor[11]="999999"

textcolor[12]="aaaaaa"

textcolor[13]="bbbbbb"

textcolor[14]="cccccc"

textcolor[15]="dddddd"

textcolor[16]="eeeeee"

textcolor[17]="ffffff"

textcolor[18]="ffffff"

varmessage=newArray()

message[0]=""

message[1]="HappyDrips工作室"

message[2]="谢谢您使用"

message[3]="javascript源码大全"

i_message=0

vari_strength=0

vari_message=0

vartimer

functionglowtext(){ 

if(document.all){

if(i_strength<=17){

glowdiv.innerText=message[i_message]

document.all.glowdiv.style.filter="glow(color="+textcolor[i_strength]+",strength=4)"

i_strength++

timer=setTimeout("glowtext()",100)

}

else{

clearTimeout(timer)

setTimeout("deglowtext()",1500)

}

}

}functiondeglowtext(){ 

if(document.all){

if(i_strength>=0){

glowdiv.innerText=message[i_message]

document.all.glowdiv.style.filter="glow(color="+textcolor[i_strength]+",strength=4)"

i_strength--

timer=setTimeout("deglowtext()",100)

}

else{

clearTimeout(timer)

i_message++

if(i_message>=message.length){i_message=0}

i_strength=0

intermezzo()

}

}

}

functionintermezzo(){ 

glowdiv.innerText=""

setTimeout("glowtext()",1500) 

}

//-->

//不要忘记写 

absolute;visibility:

visible;width:

600px;text-align:

center; 

top:

150px;left:

50px;font-family:

隶书;font-size:

30pt;color:

000000">

====2、[可选项]修改

标签内的代码可以确定文字显示的位置,颜色和大小。

top是距离屏幕上面的距离,left是距离坐侧的距离。

font-size是文字大小,

color是颜色。

width是DIV层的宽度。

由于文字是用DIV来控制的,所以在DIV的宽度范围内不能有其它内容。

DIV的位置用绝对位置(position:

absolute)表示

超酷的文字特效[特别推荐][共2步]

====1、将以下代码加入HEML的之间:

====2、将以下代码加入HEML的

:

-)

移动你的鼠标到这里来看看

href="">是不是很棒的效果

打字效果的文字特效[修改显示的文字即可]

[根据下面的说明进行共1步]

====2、以下代码放在HTML的之间[适当的位置]:

varlayers=document.layers,style=document.all,both=layers||style,idme=908601;

if(layers){layerRef='document.layers';styleRef='';}if(style){layerRef='document.all';styleRef= 

'.style';}

functionwriteOnText(obj,str){

if(layers)with(document[obj]){document.open();document.write(str);document.close();}

if(style)eval(obj+'.innerHTML=str');}

vardispStr=newArray("javascript源码大全");

varoverMe=0;

functiontxtTyper(str,idx,idObj,spObj,clr1,clr2,delay,plysnd){

vartmp0=tmp1='',skip=100;

if(both&&idx<=str.length){

if(str.charAt(idx)=='<'){while(str.charAt(idx)!

='>')idx++;idx++;}

if(str.charAt(idx)=='&'&&str.charAt(idx+1)!

=''){while(str.charAt(idx)!

=';')idx++;idx++;}

tmp0=str.slice(0,idx);

tmp1=str.charAt(idx++);

if(overMe==0&&plysnd==1){

if(navigator.plugins[0]){

if(navigator.plugins["LiveAudio"][0].type=="audio/basic"&&navigator.javaEnabled()){document.embeds

[0].stop();

setTimeout("document.embeds[0].play(false)",100);}

}elseif(document.all){

ding.Stop();

setTimeout("ding.Run()",100);}

overMe=1;}elseoverMe=0;

writeOnText(idObj,""+tmp0+"

+"'>"+tmp1+"");

setTimeout("txtTyper('"+str+"',"+idx+",'"+idObj+"','"+spObj+"','"+clr1+"','"+clr2+"',"+delay+","+plysnd+")",delay);}}

functioninit(){txtTyper(dispStr[0],0,'ttl0','ttl1','#339933','#99FF33',300,0);}

淡入淡出的文字效果[根据下面的说明进行共3步]

====1、以下代码放在HTML的之间:

--

functioncheckBrowserForVersion4(){

varx=navigator.appVersion;

y=x.substring(0,4);

if(y>=4)Effect();}

varisNav=(navigator.appName.indexOf("Netscape")!

=-1);

varcolors=newArray

("FFFFFF","FFFFFF","FFFFFF","FFFFFF","FFFFFF","FFFFFF","FFFFFF","F9F9F9","F1F1F1","E9E9E9","E1E1E1","D9D9D9","D1D1D1","C9C9C9","C1C1C1","B9B9B9","B1B1B1","A9A9A9","A1A1A1","999999","919191","898989","818181","797979","717171","696969","616161","595959","515151","494949","414141","393939","313131","292929","212121","191919","111111","090909","000000")

a=0,b=1

functionEffect(){

color=colors[a];

//*改改下面的文字内容即可,可使用HTML语法,但是注意引号不要混用。

双引号内是单引号。

*//

aa="SavepageandGetCode!

EnjoyAllTheseFreeJavascripts......"

if(isNav){document.object1.document.write(aa);document.object1.document.close();}

elseobject1.innerHTML=aa

a+=b;if(a==38)b-=2;if(a==0)b+=2;xx=setTimeout("Effect()",10);}

//-->

====2、以下代码放在HTML的之间[适当的位置]:

absolute;visibility:

show;left:

181px;top:

113px;z-index:

2">

====3、特别说明:

只要改变上面的TOP值和LEFT值即可确定文字显示的绝对位置。

TOP表示文字距离屏幕顶部的距离(象素),LEFT是离屏幕左侧的距离。

上面有一大堆乱七八糟的字符是确定渐变的颜色数组。

图片的渐显播放[推荐][根据下面的说明进行共3步,修改图片的名称及路径即可]

第三步的top:

120px;left:

240px可以设定显示的位置

====1、将下面的代码插入到HEML的之间:

 

--//

sandra0=newImage();

sandra0.src="image1.gif";

sandra1=newImage();

sandra1.src="image2.gif";

sandra2=newImage();

sandra2.src="image3.gif";

vari_strngth=1

vari_image=0

varimageurl=newArray()

imageurl[0]="图片名称1.gif"

imageurl[1]="图片名称2.gif"

imageurl[2]="图片名称3.gif"

functionshowimage(){ 

if(document.all){

if(i_strngth<=110){

testimage.innerHTML="

alpha(opacity="+i_strngth+")'src="+imageurl[i_image]+"border=0>";

i_strngth=i_strngth+10

vartimer=setTimeout("showimage()",100)

}

else{

clearTimeout(timer)

vartimer=setTimeout("hideimage()",1000)

}

}

if(document.layers){

clearTimeout(timer)

document.testimage.document.write("")

document.close()

i_image++

if(i_image>=imageurl.length){i_image=0} 

vartimer=setTimeout("showimage()",2000)

}

functionhideimage(){ 

if(i_strngth>=-10){

testimage.innerHTML="

alpha(opacity="+i_strngth+")'src="+imageurl[i_image]+"border=0>";

i_strngth=i_strngth-10

vartimer=setTimeout("hideimage()",100)

else{

clearTimeout(timer)

i_image++

if(i_image>=imageurl.length){i_image=0}

i_strngth=1

vartimer=setTimeout("sho

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 人文社科 > 文化宗教

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1