原帖由 傲雪纷飞 于 2010-8-20 11:05 发表 这个心特效没弄明白,拿不走了.
你是要那个心的特效是不?下面这个代码你直接用就好了。
<SCRIPT language=JavaScript><!-- var mousetype=2//0:mouseover 1:mouseclick 2:儔儞僟儉昞\帵 var nn=5//倁俵俴恾宍悢 var step=1//恾宍奼戝懍搙 var wamax=100//恾宍嵟戝僒僀僘 var hin=5//儅僂僗儗僗億儞僗,昿搙乮侾埲忋偺惍悢丗mouseover丄儔儞僟儉偺傒乯戝偒偔側傞偲恾宍昞\帵偑彮側偔側傝傑偡丅 var width=\"100%\"//恾宍偺尰傟傞戝偒偝丂僺僋僙儖偱巜掕偟偰傕俷俲 var height=\"100%\" var left=0 var top=0 world.style.left=left world.style.top=top world.style.width=width world.style.height=height
var iii=-1 for (i=0; i<nn; i++) { document.write(\'<v:shape id=obj\'+i+\' style=\"position:absolute; width:0; height:0; top:0; left:0; rotation:0;\" coordsize=\"100,100\" coordorigin=\"0,0\">\') document.write(\'<v:stroke id=\"objs\'+i+\'\" opacity=\"0\"/>\') document.write(\'<v:fill id=\"objf\'+i+\'\" opacity=\"0\"/>\') document.write(\'</v:shape>\') eval(\'obj\'+i+\'.path=\"\'+objo.path+\'\"\') eval(\'objs\'+i+\'.color=\"\'+objso.color+\'\"\') eval(\'objs\'+i+\'.on=\"\'+objso.on+\'\"\') eval(\'objf\'+i+\'.color=\"\'+objfo.color+\'\"\') eval(\'objf\'+i+\'.on=\"\'+objfo.on+\'\"\') }
//window.document.onmousemove = start; var offx=-5 var offy=-5 var iig=0
function start(){ iig=iig+1 if(mousetype==2){ iii=iii+1 if(iii>nn-1) iii=0 eval(\'obj\'+iii+\'.style.left=\'+Math.random()*world.offsetWidth) eval(\'obj\'+iii+\'.style.top=\'+Math.random()*world.offsetHeight) eval(\'objs\'+iii+\'.opacity=1\') eval(\'objf\'+iii+\'.opacity=1\') water(iii,0,wamax) setTimeout(\'start()\',hin*1000*Math.random()) }else{ if(iig%hin!=0) return iii=iii+1 if(iii>nn-1) iii=0 eval(\'obj\'+iii+\'.style.left=\'+(event.x + offx)) eval(\'obj\'+iii+\'.style.top=\'+(event.y + offy)) eval(\'objs\'+iii+\'.opacity=1\') eval(\'objf\'+iii+\'.opacity=1\') water(iii,0,wamax) } }
function water(no,num,numax){ eval(\'obj\'+no+\'.style.width=\'+num) eval(\'obj\'+no+\'.style.height=\'+num) eval(\'objs\'+no+\'.opacity=\'+(numax-num)/numax) eval(\'objf\'+no+\'.opacity=\'+(numax-num)/numax) if(num+step<numax){ setTimeout(\'water(\'+no+\',\'+(num+step)+\',\'+numax+\')\',50) }else{ eval(\'obj\'+no+\'.style.width=0\') eval(\'obj\'+no+\'.style.height=0\') } }
switch(mousetype){ case 0: world.onmousemove = start; break; case 1: world.onclick = start; hin=1 break; case 2: start(); break; }
// --></SCRIPT> |