Đăng nhập / Đăng ký Góp ý với Onthi.com  
Máy tính Gõ tiếng việt: On Off
Chú ý chú ý:  
 
Tìm kiếm trong diễn đàn    Từ khóa:      Người viết:  
Truy cập nhanh
 


Hướng dẫn gõ công thức toán trên onthi.com
Diễn đàn >> Tin học >> Thiết kế Web
nhatanh1992    20:02:18 Ngày 08-08-2008
Hiệu ứng làm nền web trông như Vũ Trụ !

Cái này khá hay đấy!

Hiệu ứng làm nền web trông như Vũ Trụ


Hiệu ứng này giúp trang web của bạn trông như một vũ trụ bao la, với muôn ngàn ngôi sao:



Paste code này ngay sau tag <body>:

PHP Code:

<BODY BGCOLOR="#000000" onLoad="fly()"

Paste code này tiếp theo sau tag <body>: ( Các bạn nhấp chuột phải xem phần "View Source" sẽ thấy rõ )

PHP Code:

<SCRIPT LANGUAGE="JavaScript"> <!-- Begin SmallStars 30LargeStars 10; SmallYpos = new Array(); SmallXpos = new Array(); LargeYpos = new Array(); LargeXpos = new Array(); Smallspeed= new Array(); Largespeed= new Array(); ns=(document.layers)?1:0; if (ns) { for (0SmallStarsi++) { document.write("<LAYER NAME='sn"+i+"' LEFT=0 TOP=0 BGCOLOR='#FFFFF0' CLIP='0,0,1,1'></LAYER>"); } for (0LargeStarsi++) { document.write("<LAYER NAME='ln"+i+"' LEFT=0 TOP=0 BGCOLOR='#FFFFFF' CLIP='0,0,2,2'></LAYER>"); } } else { document.write('<div style="position:absolute;top:0px;left:0px">'); document.write('<div style="position:relative">'); for (0SmallStarsi++) { document.write('<div id="si" style="position:absolute;top:0;left:0;width:1px;he ight:1px;background:#fffff0;font-size:1px"></div>'); } document.write('</div>'); document.write('</div>'); document.write('<div style="position:absolute;top:0px;left:0px">'); document.write('<div style="position:relative">'); for (0LargeStarsi++) { document.write('<div id="li" style="position:absolute;top:0;left:0;width:2px;he ight:2px;background:#ffffff;font-size:2px"></div>'); } document.write('</div>'); document.write('</div>'); } WinHeight = (document.layers)?window.innerHeight:window.docume nt.body.clientHeight; WinWidth = (document.layers)?window.innerWidth:window.documen t.body.clientWidth; for (0SmallStarsi++) { SmallYpos[i] = Math.round(Math.random() * WinHeight); SmallXpos[i] = Math.round(Math.random() * WinWidth); Smallspeed[i]= Math.random() * 1; } for (0LargeStarsi++) { LargeYpos[i] = Math.round(Math.random() * WinHeight); LargeXpos[i] = Math.round(Math.random() * WinWidth); Largespeed[i] = Math.random() * 10 5; } function fly() { var WinHeight = (document.layers)?window.innerHeight:window.docume nt.body.clientHeight; var WinWidth = (document.layers)?window.innerWidth:window.documen t.body.clientWidth; var hscrll = (document.layers)?window.pageYOffset:document.body .scrollTop; var wscrll = (document.layers)?window.pageXOffset:document.body .scrollLeft; for (0LargeStarsi++) { LargeXpos[i] -= Largespeed[i]; if (LargeXpos[i] < -10) { LargeXpos[i] = WinWidth; LargeYpos[i] = Math.round(Math.random() * WinHeight); Largespeed[i] = Math.random() * 10 5; } if (ns) { document.layers['ln'+i].left LargeXpos[i]; document.layers['ln'+i].top LargeYpos[i] + hscrll; } else { li[i].style.pixelLeft LargeXpos[i]; li[i].style.pixelTop LargeYpos[i] + hscrll; } } for (0SmallStarsi++) { SmallXpos[i] -= Smallspeed[i]; if (SmallXpos[i] < -10) { SmallXpos[i] = WinWidth; SmallYpos[i] = Math.round(Math.random()*WinHeight); Smallspeed[i] = Math.random() * 1; } if (ns) { document.layers['sn'+i].left SmallXpos[i]; document.layers['sn'+i].top SmallYpos[i]+hscrll; } else { si[i].style.pixelLeft SmallXpos[i]; si[i].style.pixelTop SmallYpos[i]+hscrll; } setTimeout('fly()'10); } // End --> </script> <!-- Script Size: 3.79 KB --> 

kent(HCE)

 

 

yoyoyo    10:44:28 Ngày 09-08-2008

mình dốt tin lăm nen chăng r hieu gì cả ban co thể nói dơn giản hơn duơc ko

 PEOnimusha    11:45:43 Ngày 09-08-2008 
Trả lời: Trả lời: Hiệu ứng làm nền web trông như Vũ Trụ !

Nói vậy là rất đơn giản rồi, nếu không biết thì là do bạn chưa đủ khả năng thôi. Cứ học cơ bản đi, đừng vội!

LuanCute    09:25:55 Ngày 22-08-2008
Trả lời: Hiệu ứng làm nền web trông như Vũ Trụ !

hứ sao mình làm mãi mà không được vậy nè

 

b0yl0vegjrl    17:59:12 Ngày 23-08-2008
Trả lời: Hiệu ứng làm nền web trông như Vũ Trụ !

đánh code này vào đâu vậy

Danh sách mod

Viết trả lời của bạn

Tiêu đề
Về vấn đề: