javascript中cursor:pointer;的意思

JavaScript04

javascript中cursor:pointer;的意思,第1张

style="cursor:pointer" 手型鼠标;

cursor:hand 与 cursor:pointer 的效果是一样,都像手形光标。但用FireFox浏览时才注意到使用cursor:hand在FireFox里并被支持。

cursor:hand :IE完全支持。但是在firefox是不支持的,没有效果。

cursor:pointer :是CSS2.0的标准。所以firefox是支持的,但是IE5.0既之前版本不支持。IE6开始支持。

<body bgColor=#000>

<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:absolutetop:0left:0"><div style="position:relative">')

for (i=0 i < amount i++)

document.write('<span id="iestars" style="position:absolutetop:0left:0width:2pxheight:2pxbackground:'+colours[i]+'font-size:2px"></span>')

document.write('</div></div>')

}

if (ns){

window.captureEvents(Event.MOUSEMOVE)

function nMouse(evnt){                               

my=evnt.pageYmx=evnt.pageX

}

window.onMouseMove=nMouse

}

else{

function iMouse(){

my=event.ymx=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>

</body>

复制,保存*.html就行