html鼠标特效代码,html鼠标特效

html鼠标特效代码,html鼠标特效,10个经典的网页鼠标特效代码

小编为广大读者们整理了10个经典的网页鼠标特效代码,并对代码进行了编译和解释,需要的朋友收藏下吧。

1、鼠标指向出现实用特殊提示

!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN ' ' http://www。w3。org/TR/XHTML 1/DTD/XHTML 1-过渡。' DTD '

html xmlns=' http://。w3。' org/1999/XHTML '

meta http-equiv=' Content-Type ' Content=' text/html;charset=utf-8' /

meta http-equiv=' Content-Language ' Content=' zh-CN '/

标题钢性铸铁打造鼠标触发效果/标题

style type='text/css '

!-

正文{

边距:0;

填充:0;

颜色:# 000;

字体大小:12px

行高:160%;

文本对齐:左对齐;

身高:100%;

字体系列: '宋体、Tahoma、arial、verdana、sans-serif、‘Lucida Grande’、‘Lucida Sans Unicode’;

}

*{边距:0;填充:0;}

h2,h2 a:链接,h2 a:悬停,h2 a:已访问{

字体大小:14px

文字-装饰:无;

颜色:# 000000;

}。千瓦_自{

填充:20像素0 0像素

边距:自动;

高度:300像素

溢出:隐藏;

宽度:650像素

}。kw_from .sbtn{

浮动:左;

宽度:80px

填充:16px 0 0

}。kw_from .searchMore{

浮动:左;

宽度:80px

填充:4px

}

#searchNav {

宽度:430像素

浮动:左;

}

#searchNav #conter1,#searchNav #conter3{

浮动:左;

宽度:250像素

}

#搜索导航#内容2,#搜索导航#内容4{

浮动:左;

宽度:180像素

}

#searchNav ul {

填充:0;

边距:0;

列表样式:无;

}

#searchNav li {

浮动:左;

}

#searchNav li ul {

显示:无;

top:20px;

}

#搜索导航李:悬停ul,#searchNav li.over ul {

显示:块;

浮动:左;

}

#阿利搜索导航{

浮动:左;

显示:块;

字体大小:12px

填充:3px

文字-装饰:无;

颜色:# 777;

}

#阿利搜索导航:悬停{

背景色:# f4f4f4

}

#searchNav #jobKw{

宽度:220像素

高度:18px

}

#searchNav #cityKw{

宽度:130像素

高度:18px

}

-

/风格

脚本类型='文本/javascript '

!- //- ![CDATA[//

!-

startList=function() {

如果(文档。所有文档。getelementbyid){

导航根=文档。getelementbyid(“搜索导航”);

for(I=0;inavroot。子节点。长度;i ) {

节点=导航根。子节点[I];

if (node.nodeName=='LI') {

node.onmouseover=function() {

这个。class name=" over

}

node.onmouseout=function() {

这个。类名=this。类名。替换(' over ',' ');

}

}

}

}

}

window.onload=startList

//- !]]

/脚本

/头

身体

div class='kw_from '

表单action='/search。' html ' method=' get ' name=' search form ' id=' search form ' on submit=' return check()'

ul id='searchNav '

李id='内容1'h2找什么/h2

输入id=' jobKw ' name=' jobKw ' type=' text '/

ul id='conter3 '

lia href='#' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部“不跟随”会计/a/李

lia href='#' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部“不跟随”网页设计/a/李

lia href='#' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部“不跟随”翻译/a/李

lia href='#' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部“不跟随”家教/a/李

lispan class=' more city ' a href=' # rel='外部不跟随' rel='外部不跟随' rel='外部不跟随' rel='外部不跟随' rel='外部不跟随' rel='外部不跟随' rel='外部不跟随' rel='外部不跟随' rel='外部不跟随' rel='外部不跟随' rel='外部不跟随' rel='外部不跟随' rel='外部不跟随' rel='外部不跟随'更多gt; gt;/a/span/li

/ul

/李

li id='conter2'h2在那里/h2

输入id='城市千瓦' name='城市千瓦' type=' text '/

ul id='conter4 '

lia href='#' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部“不跟随”北京/a/李

lia href='#' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部“不跟随”上海/a/李

lia href='#' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部“不跟随”广州/a/李

lia href='#' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部“不跟随”深圳/a/李

lia href='#' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部“不跟随”南京/a/李

lia href='#' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部“不跟随”天津/a/李

lia href='#' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部“不跟随”杭州/a/李

lia href='#' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部“不跟随”成都/a/李

lia href='#' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部“不跟随”重庆/a/李

lia href='#' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部“不跟随”武汉/a/李

lia href='#' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部“不跟随”西安/a/李

lia href='#' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部nofollow' rel='外部“不跟随”沈阳/a/李

lispan class=' more city ' a href=' # rel='外部不跟随' rel='外部不跟随' rel='外部不跟随' rel='外部不跟随' rel='外部不跟随' rel='外部不跟随' rel='外部不跟随' rel='外部不跟随' rel='外部不跟随' rel='外部不跟随' rel='外部不跟随' rel='外部不跟随' rel='外部不跟随' rel='外部不跟随'更多城市gt; gt;/a/span/li

/ul

/李

/ul

div class='sbtn '

input name=' submit ' type=' submit ' class=' BTN 4 ' style=' margin:0px 15px 2px 0;'值='搜索工作' /

/div

div class='searchMore '

a href=' search _ expert。html ' rel='外部无跟随'高级搜索/ABR/a href=' search _ sort。html ' rel='外部无跟随'分类搜索/a /div

/表单

/div

/body

/html

2、跟随鼠标的流星

超文本标记语言

标题网页特效-跟随鼠标的流星/标题

meta content=' text/html;charset=GB 2312 ' http-equiv=' Content-Type '

/头

body bgColor='#000000 '

脚本语言='JavaScript '

!-

Clrs=新数组(' ff0000 ',' 00ff00 ',' ffffff ',' ff00ff ',' ffa500 ',' ffff00 ',' 00ff00 ',' ffffff ',' ff00ff ')

定义变量速度=1;

var RunTime=0;

var cntr=0;

var xcntr=100

var Nslayers

定义变量脉冲=25;

var onClrs

var Xpos=421

var Ypos=231

var _ y;

if (document.layers){

window.captureEvents(事件MOUSEMOVE);

函数xFollowMouse(evnt){

Xpos=evnt.pageX

Ypos=evnt.pageY

}

窗户。onmousemove=xfollow mouse

文档。write(' layer name=' A0 ' left=10 top=10 bgcolor=' # ff 0000 ' clip=' 0,0,2,2'/layer '

layer name=' a1 ' left=10 top=10 bgcolor=' # 00ff 00 ' clip=' 0,0,2,2'/layer '

layer name=' a2 ' left=10 top=10 bgcolor=' # ffffff ' clip=' 0,0,2,2'/layer '

layer name=' a3 ' left=10 top=10 bgcolor=' # FFA 500 ' clip=' 0,0,2,2'/layer '

layer name=' a4 ' left=10 top=10 bgcolor=' # ff 00 ff ' clip=' 0,0,2,2'/layer '

layer name=' a5 ' left=10 top=10 bgcolor=' # 8888 ff ' clip=' 0,0,2,2'/layer '

layer name=' a6 ' left=10 top=10 bgcolor=' # fff 000 ' clip=' 0,0,2,2 '/layer ');

}

else if (document.all){

函数FollowMouse(){

xpos=文档。身体。向左滚动事件。x;

ypos=文档。身体。滚动顶部事件。y;

}

文档。onmousemove=跟随鼠标;

文档。write(' div id=' ieDiv ' style=' position:absolute;top:0px;左:0px ' '

div id=' c ' style=' position:relative ' '

div style=' position:absolute;top:0px;左:0px宽度:2px高度:2px背景:# ff0000font-size:2px'/div '

div style=' position:absolute;top:0px;左:0px宽度:2px高度:2px背景:# 00ff00font-size:2px'/div '

div style=' position:absolute;top:0px;左:0px宽度:2px高度:2px背景:# fffffffont-size:2px'/div '

div style=' position:absolute;top:0px;左:0px宽度:2px高度:2px背景:# ffa500font-size:2px'/div '

div style=' position:absolute;top:0px;左:0px宽度:2px高度:2px背景:# ff 00 fffont-size:2px'/div '

div style=' position:absolute;top:0px;左:0px宽度:2px高度:2px背景:# 8888fffont-size:2px'/div '

div style=' position:absolute;top:0px;左:0px宽度:2px高度:2px背景:# fff000font-size:2px'/div '

/div '

/div’);

}

函数sv2(){

if (document.layers){

for(I=0;i7;我)

{

nslayers=' a ' I;

document.layers[0].top=Ypos cntr*Math.cos((运行时I * 4.5)/5);

document.layers[0].left=Xpos cntr*Math.sin((运行时I * 4.5)/5);

var rand col=数学。圆(数学。random()* 8);

document.layers[0].bgColor=Clrs[rand col];

}

cntr=1;

运行时间=速度;

stp=setTimeout('sv2()',10);

如果(计数器=100)

{

cntr=100

速度=2.5;

for(I=0;i7;我)

{

nslayers=' a ' I;

document.layers[Nslayers].top=Ypos cntr*Math.cos((运行时-100)* I/90);

document.layers[Nslayers].left=Xpos cntr*Math.sin((运行时-100)* I/90);

}

}

如果(运行时间182)

{

速度=0.5;

for(I=0;i7;我)

{

nslayers=' a ' I;

document.layers[Nslayers].top=Ypos xcntr*Math.cos((运行时-182) i*4.5)/5)*Math.cos((运行时-182)/5);

document.layers[Nslayers].left=Xpos xcntr * math。sin((RunTime-182)I * 4.5)/5);

}

}

}

else if (document.all){

for(I=0;iie部门。全部。c .所有。长度;我)

{

var rand col=数学。圆(数学。random()* 8);

iediv。全部。c .所有[0]。风格。background=Clrs[rand col];

iediv。全部。c .所有[0]。风格。top=Ypos cntr *数学。cos((运行时I * 4.5)/5);

iediv。全部。c .所有[0]。风格。left=Xpos cntr * math。罪恶(运行时I * 4.5)/5);

}

cntr=1;

运行时间=速度;

window.status=运行库

stp=setTimeout('sv2()',10);

如果(计数器=100)

{

cntr=100

速度=2.5;

for(I=0;iie部门。全部。c .所有。长度;我)

{

iediv。全部。c .所有[我]。风格。top=Ypos cntr *数学。cos((运行时-100)* I/90);

iediv。全部。c .所有[我]。风格。left=Xpos cntr * math。sin((运行时-100)* I/90);

}

}

如果(运行时间182)

{

速度=0.5;

for(I=0;iie部门。全部。c .所有。长度;我)

{

iediv。全部。c .所有[我]。风格。top=Ypos xcntr * math。cos((运行时-182) i*4.5)/5)*Math.cos((运行时-182)/5);

iediv。全部。c .所有[我]。风格。left=Xpos xcntr * math。sin((RunTime-182)I * 4.5)/5);

}

}

}

如果(运行时间210)

{

xcntr-=10;

}

如果(文档。图层)

_ y=-窗口。内宽-90;

else if (document.all)

_ y=-文档。身体。客户端宽度-90;

if (xcntr=_y)

{

运行时=0;

速度=1;

cntr=0;

xcntr=100

}

}

sv2()

//-

/脚本

/body

/html

3、跟随鼠标的三色彩带

超文本标记语言

标题网页特效-很酷的跟随鼠标的三色彩带/标题

/床头板bgColor=#000000

!-将以下代码加入超文本标记语言的身体/身体之间-

脚本语言='JavaScript '

!-

var a _ Colour=' fff000

var b _ Colour=' 00ff00

var c _ Colour=' ff00ff

var Size=120

var YDummy=new Array(),XDummy=new Array(),xpos=0,ypos=0,这一步=0;步长=0.6;

if (document.layers){

window.captureEvents(事件MOUSEMOVE);

函数nsMouse(evnt){

xpos=窗口。页面偏移事件。pagex 6;

ypos=窗口。页面偏移事件。pagey 16

}

window.onMouseMove=nsMouse

}

else if (document.all)

{

函数ieMouse(){

xpos=文档。身体。向左滚动事件。x 6;

ypos=文档。身体。滚动顶部事件。y 16

}

document.onmousemove=ieMouse

}

函数漩涡(){

for(I=0;i3;我)

{

YDummy[I]=ypos大小*数学。sin((1 *数学。sin((这一步)/10))I * 2)*数学。sin((这一步)/4);

xdument[I]=xpos大小*数学。cos((1 *数学。sin((这一步)/10))I * 2)*数学。sin((这一步)/4);

}

这一步=一步

setTimeout('swirl()',10);

}

定义变量金额=10;

if (document.layers){

for(I=0;一、金额;我)

{

文档。写(' layer name=NSA ' I ' top=0 left=0 width=' I/2 ' height=' I/2 ' bgcolor=' a _ Colour '/layer));

文档。write(' layer name=nsb ' I ' top=0 left=0 width=' I/2 ' height=' I/2 ' bgcolor=' b _ Colour '/layer));

文档。write(' layer name=NSC ' I ' top=0 left=0 width=' I/2 ' height=' I/2 ' bgcolor=' c _ Colour '/layer));

}

}

else if (document.all){

文档。write(' div id=' ODiv ' style=' position:absolute;top:0px;左:0px ' '

div id=' IDiv ' style=' position:relative ' ');

for(I=0;一、金额;我)

{

文档。写(' div id=x style=' position:absolute;top:0px;左:0px宽度:“I/2”;高度:' I/2 ';背景:' a _ Colour ';font-size:' I/2 ' '/div ');

文档。写(' div id=y style=' position:absolute;top:0px;左:0px宽度:“I/2”;高度:' I/2 ';背景:' b _ Colour ';font-size:' I/2 ' '/div ');

文档。写(' div id=z style=' position:absolute;top:0px;左:0px宽度:“I/2”;高度:' I/2 ';背景:' c _ Colour ';font-size:' I/2 ' '/div ');

}

文档。write('/div/div ');

}

函数prepos(){

var ntscp=document.layers

var msie=document.all

if (document.layers){

for(I=0;一、金额;我)

{

如果(我数量-1)

{

美国国家安全局top=ntscp['nsa' (i 1)].顶;美国国家安全局left=ntscp['nsa' (i 1)].左;

ntscp[nsb ' I].top=ntscp['nsb' (i 1)].顶;ntscp[nsb ' I].left=ntscp['nsb' (i 1)].左;

国家安全委员会top=ntscp['nsc' (i 1)].顶;国家安全委员会left=ntscp['nsc' (i 1)].左;

}

其他

{

美国国家安全局. top=y dummy[0];美国国家安全局. left=xdu mid[0];

ntscp[nsb ' I].top=y假人[1];ntscp[nsb ' I].left=xd ument[1];

国家安全委员会. top=YDummy[2];国家安全委员会. left=xd ument[2];

}

}

}

else if (document.all){

for(I=0;一、金额;我)

{

如果(我数量-1)

{

msie。x[I]。风格。top=msie。x[I 1]。风格。顶;msie。x[I]。风格。左=msie。x[I 1]。风格。左;

msie。y[I]。风格。top=msie。y[I 1]。风格。顶;msie。y[I]。风格。左=msie。y[I 1]。风格。左;

msie。z[I]。风格。top=msie。z[I 1]。风格。顶;msie。z[I]。风格。左=msie。z[I 1]。风格。左;

}

其他

{

msie。x[I]。风格。top=y dummy[0];msie。x[I]。风格。left=xdu mid[0];

msie。y[I]。风格。top=y dummy[1];msie。y[I]。风格。left=xdu mid[1];

msie。z[I]。风格。top=YDummy[2];msie。z[I]。风格。left=xdu mid[2];

}

}

}

setTimeout('prepos()',10);

}

函数Start(){

漩涡(),前置()

}

window.onload=Start

//-

/脚本

& amp

lt;/body></html>

4、鼠标经过滚动提示文字

<a href="http://www.网址.com" rel="external nofollow" _fcksavedurl="http://www.网址.com" target="_blank" onMouseOver="helpor_net_show(this,event,'网页鼠标特效')" onMouseOut="helpor_net_hide()">把鼠标放上来试试</a> <div id="tooltip2" style="position:absolute;visibility:hidden;clip:rect(0 150 50 0);width:150px;background-color:seashell"> <layer name="nstip" width="1000px" bgColor="seashell"></layer> </div> <SCRIPT language="JavaScript"> <!-- if (!document.layers&&!document.all) event="test" function helpor_net_show(current,e,text){ if (document.all&&document.readyState=="complete"){ document.all.tooltip2.innerHTML='<marquee style="border:1px solid #3399ff">'+text+'</marquee>' document.all.tooltip2.style.pixelLeft=event.clientX+document.body.scrollLeft+10 document.all.tooltip2.style.pixelTop=event.clientY+document.body.scrollTop+10 document.all.tooltip2.style.visibility="visible" } else if (document.layers){ document.tooltip2.document.nstip.document.write('<b>'+text+'</b>') document.tooltip2.document.nstip.document.close() document.tooltip2.document.nstip.left=0 currentscroll=setInterval("scrolltip()",100) document.tooltip2.left=e.pageX+10 document.tooltip2.top=e.pageY+10 document.tooltip2.visibility="show" } } function helpor_net_hide(){ if (document.all) document.all.tooltip2.style.visibility="hidden" else if (document.layers){ clearInterval(currentscroll) document.tooltip2.visibility="hidden" } } function scrolltip(){ if (document.tooltip2.document.nstip.left>=-document.tooltip2.document.nstip.document.width) document.tooltip2.document.nstip.left-=5 else document.tooltip2.document.nstip.left=150 } //--> </SCRIPT>

5、围绕鼠标旋转的三叶空间旋浆

<html> <head> <title>围绕鼠标旋转的三叶空间旋浆</title> <meta content="text/html; charset=gb2312" http-equiv="Content-Type"> </head> <body bgColor="#000000"> <script language="JavaScript"> <!-- //To add more stars simply add more colours in below array!! colours=new Array('ff0000','00ff00','3366ff','ff00ff','ffa500','ffffff','fff000') //Alter nothing below!! amount=colours.length; YgetDelay=0,XgetDelay=0,Ydelay=0,Xdelay=0,ns=(document.layers)?1:0,step=0.2,currStep=0,my=0,mx=0; if (ns){ for (i=0; i < amount; i++) document.write('<LAYER NAME="nsstars'+i+'" BGCOLOR='+colours[i]+' CLIP="0,0,2,2"></LAYER>'); } else{ document.write('<div id="ie" style="position:absolute;top:0;left:0;"><div style="position:relative">'); for (i=0; i < amount; i++) document.write('<span id="iestars" style="position:absolute;top:0;left:0;width:2px;height:2px;background:'+colours[i]+';font-size:2px"></span>'); document.write('</div></div>'); } if (ns){ window.captureEvents(Event.MOUSEMOVE); function nMouse(evnt){ my=evnt.pageY;mx=evnt.pageX } window.onMouseMove=nMouse; } else{ function iMouse(){ my=event.y;mx=event.x; } document.onmousemove=iMouse } function stars(){ if (!ns)ie.style.top=document.body.scrollTop; for (i=0; i < amount; i++) { var layer=(document.layers)?document.layers["nsstars"+i]:iestars[i].style; layer.top= Ydelay+100*Math.sin((5*Math.sin((currStep-15.99)/10))+i*70)*Math.sin((currStep)/10)*Math.cos((currStep+i*25)/10); layer.left=Xdelay+180*Math.cos((5*Math.sin((currStep-15.99)/10))+i*70)*Math.sin((currStep)/10)*Math.cos((currStep+i*25)/10); } currStep+=step; } function delay(){ Ydelay = YgetDelay+=(my-YgetDelay)*1/20; Xdelay = XgetDelay+=(mx-XgetDelay)*1/20; stars(); setTimeout('delay()',10); } delay(); //--> </script> <script language="JavaScript"> <!-- hide function goHist(a) { history.go(a); } //--> </script> </body> </html>

6、围绕鼠标的立体星环(摩天轮)

<html> <head> <title>围绕鼠标的立体星环</title> <meta content="text/html; charset=gb2312" http-equiv="Content-Type"> <script language="JavaScript"> <!-- ns=(document.layers)?1:0; Clrs=new Array('ff0000','00ff00','ffffff','ff00ff','ffa500','ffff00','00ff00','ffffff','ff00ff') var amount=8 var step=0.3; var currStep=0; var Ypos=0; var Xpos=0; if (ns){ for (i=0; i < amount; i++) document.write('<LAYER NAME="n'+i+'" LEFT=0 TOP=0 BGCOLOR=#FFFFFF CLIP="0,0,2,2"></LAYER>'); window.captureEvents(Event.MOUSEMOVE); function nMouse(evnt){ Ypos = evnt.pageY; Xpos = evnt.pageX; } window.onMouseMove=nMouse; } else{ document.write('<div style="position:absolute;top:0px;left:0px">'); document.write('<div style="position:relative">'); for (i=0; i < amount; i++) document.write('<div id="me" style="position:absolute;top:0px;left:0px;width:2px;height:2px;font-size:2px;background:#00aaff"></div>'); document.write('</div></div>'); function iMouse(){ Ypos=event.y+document.body.scrollTop; Xpos=event.x+document.body.scrollLeft; } document.onmousemove = iMouse; } function Comet(){ for (i=0; i < amount; i++){ var randCol=Math.floor(Math.random()*Clrs.length); var layer=(document.layers)?document.layers['n'+i]:me[i].style; layer.top =Ypos+60*Math.sin((currStep + i*3.1)/4)*Math.cos(currStep/10); layer.left=Xpos+60*Math.cos((currStep + i*3.1)/4); if (ns) layer.bgColor=Clrs[randCol];else layer.background=Clrs[randCol]; } currStep+=step; setTimeout("Comet()",10); } window.onload=Comet; // --> </script> </head> <body bgcolor="#000000"> </body> </html>

7、围绕鼠标的立体旋转文字

<html> <head> <title>围绕鼠标的立体旋转文字</title> <meta content="text/html; charset=gb2312" http-equiv="Content-Type"> <meta content="Microsoft FrontPage 5.0" name="GENERATOR"> </head> <body> <script LANGUAGE="JavaScript"> <!-- Begin if (document.all) { yourLogo = "网页制作大宝库"; //Not less than 2 letters! logoFont = "Arial"; logoColor = "ff0000"; //Nothing needs altering below! yourLogo = yourLogo.split(''); L = yourLogo.length; TrigSplit = 360 / L; Sz = new Array() logoWidth = 100; logoHeight = -30; ypos = 0; xpos = 0; step = 0.09; currStep = 0; document.write('<div id="outer" style="position:absolute;top:0px;left:0px"><div style="position:relative">'); for (i = 0; i < L; i++) { document.write('<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">'+yourLogo[i]+'</div>'); } document.write('</div></div>'); function Mouse() { ypos = event.y; xpos = event.x - 5; } document.onmousemove=Mouse; function animateLogo() { outer.style.pixelTop = document.body.scrollTop; for (i = 0; i < L; i++) { ie[i].style.top = ypos + logoHeight * Math.sin(currStep + i * TrigSplit * Math.PI / 180); ie[i].style.left = xpos + logoWidth * Math.cos(currStep + i * TrigSplit * Math.PI / 180); Sz[i] = ie[i].style.pixelTop - ypos; if (Sz[i] < 5) Sz[i] = 5; ie[i].style.fontSize = Sz[i] / 1.7; } currStep -= step; setTimeout('animateLogo()', 20); } window.onload = animateLogo; } // End --> </script> </body> </html>

8、跟随鼠标的日期时间表盘

<html> <head> <title>跟随鼠标的日期时间表盘</title> </head><BODY> <!--将以下代码加入HTML的<Body></Body>之间--> <SCRIPT language=JavaScript> <!-- dCol="0000FF" fCol="FF0000" sCol="00FF00" mCol="000000" hCol="000000" ClockHeight=40; ClockWidth=40; ClockFromMouseY=0; ClockFromMouseX=100; d=new Array("星期日","星期一","星期二","星期三","星期四","星期五","星期六"); m=new Array("1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"); date=new Date(); day=date.getDate(); year=date.getYear(); if (year < 2000) year=year+1900; TodaysDate="年 "+m[date.getMonth()]+" "+day+"日 "+d[date.getDay()]+" "+year; D=TodaysDate.split(''); H='...'; H=H.split(''); M='....'; M=M.split(''); S='.....'; S=S.split(''); Face='1 2 3 4 5 6 7 8 9 10 11 12'; font='Arial'; size=1; speed=0.6; ns=(document.layers); ie=(document.all); Face=Face.split(' '); n=Face.length; a=size*10; ymouse=0; xmouse=0; scrll=0; props="<font face="+font+" size="+size+" color="+fCol+">"; props2="<font face="+font+" size="+size+" color="+dCol+">"; Split=360/n; Dsplit=360/D.length; HandHeight=ClockHeight/4.5 HandWidth=ClockWidth/4.5 HandY=-7; HandX=-2.5; scrll=0; step=0.06; currStep=0; y=new Array();x=new Array();Y=new Array();X=new Array(); for (i=0; i < n; i++){y[i]=0;x[i]=0;Y[i]=0;X[i]=0} Dy=new Array();Dx=new Array();DY=new Array();DX=new Array(); for (i=0; i < D.length; i++){Dy[i]=0;Dx[i]=0;DY[i]=0;DX[i]=0} if (ns){ for (i=0; i < D.length; i++) document.write('<layer name="nsDate'+i+'" top=0 left=0 height='+a+' width='+a+'><center>'+props2+D[i]+'</font></center></layer>'); for (i=0; i < n; i++) document.write('<layer name="nsFace'+i+'" top=0 left=0 height='+a+' width='+a+'><center>'+props+Face[i]+'</font></center></layer>'); for (i=0; i < S.length; i++) document.write('<layer name=nsSeconds'+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+sCol+'><center><b>'+S[i]+'</b></center></font></layer>'); for (i=0; i < M.length; i++) document.write('<layer name=nsMinutes'+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+mCol+'><center><b>'+M[i]+'</b></center></font></layer>'); for (i=0; i < H.length; i++) document.write('<layer name=nsHours'+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+hCol+'><center><b>'+H[i]+'</b></center></font></layer>'); } if (ie){ document.write('<div id="Od" style="position:absolute;top:0px;left:0px"><div style="position:relative">'); for (i=0; i < D.length; i++) document.write('<div id="ieDate" style="position:absolute;top:0px;left:0;height:'+a+';width:'+a+';text-align:center">'+props2+D[i]+'</font></div>'); document.write('</div></div>'); document.write('<div id="Of" style="position:absolute;top:0px;left:0px"><div style="position:relative">'); for (i=0; i < n; i++) document.write('<div id="ieFace" style="position:absolute;top:0px;left:0;height:'+a+';width:'+a+';text-align:center">'+props+Face[i]+'</font></div>'); document.write('</div></div>'); document.write('<div id="Oh" style="position:absolute;top:0px;left:0px"><div style="position:relative">'); for (i=0; i < H.length; i++) document.write('<div id="ieHours" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+hCol+';text-align:center;font-weight:bold">'+H[i]+'</div>'); document.write('</div></div>'); document.write('<div id="Om" style="position:absolute;top:0px;left:0px"><div style="position:relative">'); for (i=0; i < M.length; i++) document.write('<div id="ieMinutes" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+mCol+';text-align:center;font-weight:bold">'+M[i]+'</div>'); document.write('</div></div>') document.write('<div id="Os" style="position:absolute;top:0px;left:0px"><div style="position:relative">'); for (i=0; i < S.length; i++) document.write('<div id="ieSeconds" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+sCol+';text-align:center;font-weight:bold">'+S[i]+'</div>'); document.write('</div></div>') } (ns)?window.captureEvents(Event.MOUSEMOVE):0; function Mouse(evnt){ ymouse = (ns)?evnt.pageY+ClockFromMouseY-(window.pageYOffset):event.y+ClockFromMouseY; xmouse = (ns)?evnt.pageX+ClockFromMouseX:event.x+ClockFromMouseX; } (ns)?window.onMouseMove=Mouse:document.onmousemove=Mouse; function ClockAndAssign(){ time = new Date (); secs = time.getSeconds(); sec = -1.57 + Math.PI * secs/30; mins = time.getMinutes(); min = -1.57 + Math.PI * mins/30; hr = time.getHours(); hrs = -1.575 + Math.PI * hr/6+Math.PI*parseInt(time.getMinutes())/360; if (ie){ Od.style.top=window.document.body.scrollTop; Of.style.top=window.document.body.scrollTop; Oh.style.top=window.document.body.scrollTop; Om.style.top=window.document.body.scrollTop; Os.style.top=window.document.body.scrollTop; } for (i=0; i < n; i++){ var F=(ns)?document.layers['nsFace'+i]:ieFace[i].style; F.top=y[i] + ClockHeight*Math.sin(-1.0471 + i*Split*Math.PI/180)+scrll; F.left=x[i] + ClockWidth*Math.cos(-1.0471 + i*Split*Math.PI/180); } for (i=0; i < H.length; i++){ var HL=(ns)?document.layers['nsHours'+i]:ieHours[i].style; HL.top=y[i]+HandY+(i*HandHeight)*Math.sin(hrs)+scrll; HL.left=x[i]+HandX+(i*HandWidth)*Math.cos(hrs); } for (i=0; i < M.length; i++){ var ML=(ns)?document.layers['nsMinutes'+i]:ieMinutes[i].style; ML.top=y[i]+HandY+(i*HandHeight)*Math.sin(min)+scrll; ML.left=x[i]+HandX+(i*HandWidth)*Math.cos(min); } for (i=0; i < S.length; i++){ var SL=(ns)?document.layers['nsSeconds'+i]:ieSeconds[i].style; SL.top=y[i]+HandY+(i*HandHeight)*Math.sin(sec)+scrll; SL.left=x[i]+HandX+(i*HandWidth)*Math.cos(sec); } for (i=0; i < D.length; i++){ var DL=(ns)?document.layers['nsDate'+i]:ieDate[i].style; DL.top=Dy[i] + ClockHeight*1.5*Math.sin(currStep+i*Dsplit*Math.PI/180)+scrll; DL.left=Dx[i] + ClockWidth*1.5*Math.cos(currStep+i*Dsplit*Math.PI/180); } currStep-=step; } function Delay(){ scrll=(ns)?window.pageYOffset:0; Dy[0]=Math.round(DY[0]+=((ymouse)-DY[0])*speed); Dx[0]=Math.round(DX[0]+=((xmouse)-DX[0])*speed); for (i=1; i < D.length; i++){ Dy[i]=Math.round(DY[i]+=(Dy[i-1]-DY[i])*speed); Dx[i]=Math.round(DX[i]+=(Dx[i-1]-DX[i])*speed); } y[0]=Math.round(Y[0]+=((ymouse)-Y[0])*speed); x[0]=Math.round(X[0]+=((xmouse)-X[0])*speed); for (i=1; i < n; i++){ y[i]=Math.round(Y[i]+=(y[i-1]-Y[i])*speed); x[i]=Math.round(X[i]+=(x[i-1]-X[i])*speed); } ClockAndAssign(); setTimeout('Delay()',40); } if (ns||ie)window.onload=Delay; //--> </SCRIPT> </body></html>

9、很有特色的荧光鼠标

<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>很有特色的荧光鼠标</title> <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> </head> <body id="mybody" style="filter:light(enabled=1);" bgcolor="#ffffff" text="#000000"> <div id="Layer1" style="height: 32; left: 66; position: absolute; top: 41; width: 52"> <dd> <div align="right"> <img src="images/light.gif" width="29" height="30"> </div> </dd> </div> <p align="center"><b><font size="5">日落大道上的亚洲男孩 </font></b> </p> <table border="0" width="100%"> <tr> <td width="82%"><font face="宋体" color="#FF00FF" style="font-size: 9pt"> </font><span style="font-size: 9pt"> 人人爱谈张爱玲,尤其在论及服饰的时候。我不能免俗,也来附庸风雅一番。张爱玲纪念文集提到她逝世时的寓所,地址非常眼熟,后来才知道那公寓就在UC LA正门附近。我和朋友好奇心起,课后前去朝圣一番,发现果真就是文集照片中的公寓,只不过屋前绿树茁壮更胜以往,和目前公寓的灰暗色调形成讽刺对比。耳闻张爱玲生前喜欢在UCLA附近不时搬迁,居无定所,像一头中枪后逃逸的狐狸,不停回头将沿路滴落的血迹舐去,以免猎人循迹跟上。 <br> <br>   我以刚出道的猎人口吻说∶传言中张的住所很狼狈,她的衣物都随便搁在纸箱或超级市场收集来的塑胶袋里唷。 <br> <br>   比我早来洛杉矶数年的同行朋友却说∶有何奇怪?我的衣物书籍也都塞在纸箱和塑胶袋里。搬家的时候反而方便啊。 <br> <br>   朋友的粗廉生活让我很不以为然;当时我才初抵美国未久。 <br> <br>   试想,任何华丽的衣裳只要一落进超级市场塑胶袋,看起来就像垃圾。把生活尽数装在塑胶袋里,岂不是将自己完全垃圾化? <br> <br>   但,在开始租屋、收集家具之后,我也开始世故驯化。留学生余钱无多,时常面临搬家压力。因此,我很少购衣;如要花钱,选择并不多。 <br> <br>   从UCLA门口驱车南行,经过张爱玲故居,就来到了”ROSS“成衣批发店。ROSS陈列满坑满谷的名牌服饰,但因都是瑕疵品,比如说胸口的商标掉到肚脐位置的马球衫之类,张冠李戴,品质荒唐,所以售价低廉。许多经济能力较差的黑人和墨西哥人就来这里翻索便宜的CK、耐吉、DKNY;我加入他们肤色鲜艳的行列,结帐时将微疵的战利品装在塑胶袋里-而非百货公司的雅痞纸袋。说不定当年张爱玲也曾经蹋著脸徒步到这里找便宜货,混迹各色人种之间,没有人认出她何许人也。 <br> <br>   虽然每次光顾ROSS都省了钱,而且享受与有色人种站在同一阵线的政治正确虚荣感,但每一次的经验都极其卑微沮丧。好莱坞电影中,彩色画报里,那种昂首阔步走进香蕉共和国的潇洒意象,在现实美国里却好遥远。还是认份光顾量贩店,站在平庸空间里排队,细细咀嚼外国人的贫穷滋味。 <br> <br>   时装海报里,那些空灵的躯干之间,并没有留下什么空位给我者。 <br> <br>   在日落大道两岸,巨幅时装广告海报一张张浮悬空中,像敦煌壁画,海报里俊男美女睥睨众生,佛似的自在庄严,日落大道一如当代加 <br> <br>   州的丝路。AF,Abercrombie & Fitch的白人男孩在阳光下微笑展示金身,好生慈悲。我猜美国当前年轻男性最风靡的服饰品牌之一大概就是AF,青春的傲慢包装成若无其事的天真潇洒。难怪校园里穿AF的大男孩比比皆是(怪的是,任何人穿了AF就会变得性感);许多男同志也表示,看了AF男孩就会流口水(许多人在徵友广告中表明,想要找AF风格的男孩)。记得春天清晨我行过波士顿哈佛大学,赫然发现哈佛广场前最招摇的海报就来自AF,金发男孩的美丽笑脸占据了整个橱窗,诡异的意象。光是一张笑脸就比一家书店还要庞大。我望之却步了。 <br> <br>   </span></td> </tr> </table> <script language="vbscript"> dim red,gre,blu dim x,y,z red=255 gre=255 blu=0 z=100 sub window_onload() call mybody.filters.light.addPoint(0,0,z,Red,Gre,Blu,100) mybody.style.cursor="hand" end sub sub document_onmousemove() x=window.event.x y=window.event.y call mybody.filters.Light.MoveLight(0, x, y, 100, 1) end sub </script> <script language="javascript"> //这是使图层移动的函数 function move_layer() { Layer1.style.left=event.clientX+document.body.scrollLeft-50; Layer1.style.top=event.clientY+document.body.scrollTop-20; } //这里的意思是,如果鼠标移动时就调用"move_layer"函数 document.onmousemove =move_layer; </script> </body> </html>

10、跟随鼠标的幻影文字

<html> <head> <title>中国站长站--跟随鼠标的幻影文字</title> </head> <body> <script LANGUAGE="JavaScript"> <!-- Begin message = '欢迎访问网页制作大宝库!'; FonT = 'Verdana'; ColoR = 'ff0000'; SizE = 3; //1 to 7 only! var amount = 5, ypos =- 50, 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=nsl'+i+' top=0 left=0><font face='+FonT+' size='+SizE+' color='+ColoR+'>'+message+'</font></layer>'); } window.captureEvents(Event.MOUSEMOVE); function nsmouse(evnt) { xpos = evnt.pageX + 20; ypos = evnt.pageY + 20; } window.onMouseMove = nsmouse; } else if (document.all) { document.write("<div id='outer' style='position:absolute;top:0px;left:0px'>"); document.write("<div style='position:relative'>"); for (i = 0; i < amount; i++) { document.write('<div id="text"'+i+' style="position:absolute;top:0px;left:0px;width:400px;height:20px"><font face='+FonT+' size='+SizE+' color='+ColoR+'>'+message+'</font></div>') } document.write("</div>"); document.write("</div>"); function iemouse() { ypos = event.y + 20; xpos = event.x + 20; } window.document.onmousemove = iemouse; } function makefollow() { if (document.layers) { document.layers['nsl'+0].top = ay; document.layers['nsl'+0].left = ax; document.layers['nsl'+1].top = by; document.layers['nsl'+1].left = bx; document.layers['nsl'+2].top = cy; document.layers['nsl'+2].left = cx; document.layers['nsl'+3].top = Dy; document.layers['nsl'+3].left = Dx; document.layers['nsl'+4].top = Ey; document.layers['nsl'+4].left = Ex; } else if (document.all) { outer.style.pixelTop = document.body.scrollTop; text[0].style.pixelTop = ay; text[0].style.pixelLeft = ax; text[1].style.pixelTop = by; text[1].style.pixelLeft = bx; text[2].style.pixelTop = cy; text[2].style.pixelLeft = cx; text[3].style.pixelTop = Dy; text[3].style.pixelLeft = Dx; text[4].style.pixelTop = Ey; text[4].style.pixelLeft = Ex; } } function move() { ey = Ey += (ypos - Ey) * 0.2; ex = Ex += (xpos - Ex) * 0.2; dy = Dy += (ey - Dy) * 0.3; dx = Dx += (ex - Dx) * 0.3; cy = Cy += (dy - Cy) * 0.4; cx = Cx += (dx - Cx) * 0.4; by = By += (cy - By) * 0.5; bx = Bx += (cx - Bx) * 0.5; ay = Ay += (by - Ay) * 0.6; ax = Ax += (bx - Ax) * 0.6; makefollow(); setTimeout('move()', 100); } window.onload=move; // End --> </script> </body> </html>

郑重声明:本文由网友发布,不代表盛行IT的观点,版权归原作者所有,仅为传播更多信息之目的,如有侵权请联系,我们将第一时间修改或删除,多谢。

相关文章阅读

  • vue监听指定按钮加点击事件,vue按钮点击事件,vue双击事件2.0事件监听(点击-双击-鼠标事件)和事件修饰符操作
  • js鼠标触碰事件,js鼠标事件包括哪几种
  • js鼠标触碰事件,js鼠标事件包括哪几种,关于js中的鼠标事件总结
  • js鼠标拖动div,js 移动鼠标
  • js鼠标拖动div,js 移动鼠标,JS实现简单移动端鼠标拖拽
  • js怎么实现点击按钮图片切换,js鼠标点击按钮图片移动
  • js怎么实现点击按钮图片切换,js鼠标点击按钮图片移动,js鼠标点击图片切换效果代码分享
  • js小球跟随鼠标移动,js鼠标跟随特效
  • js小球跟随鼠标移动,js鼠标跟随特效,js实现鼠标跟随小游戏
  • jquery鼠标悬停二级菜单,jquery鼠标悬停按钮切换图片
  • jquery鼠标悬停二级菜单,jquery鼠标悬停按钮切换图片,jQuery实现鼠标悬停3d菜单展开动画效果
  • html鼠标特效代码,html鼠标特效,10个经典的网页鼠标特效代码
  • win7鼠标滚轮上下失灵,win7鼠标滚轮用不了
  • thinkpad usb口不能用 鼠标,thinkpad电脑怎么禁用触控
  • win10鼠标点击速度,win10鼠标加速度在哪里
  • 留言与评论(共有 条评论)
       
    验证码: