Go Back   VN-Zoom forum > Chia sẻ kiến thức > Lập trình > HTML / CSS / Javascript

 

Hãy là người biết chia sẻ!

Trả lời
 
Ðiều Chỉnh Xếp Bài
Old 04-07-2008, 20:03   #1
Rìu Sắt
 
hungarirang's Avatar
 
Tham gia: Feb 2008
Bài: 142
VZD: 2.796
Cảm ơn: 24
Điểm: 33/23 bài viết
Default share cho 1 mớ

Hiệu ứng tuyết rơi

Trích:
<SCRIPT language=JavaScript1.2>
<!-- Original: Altan (snow@altan.hr) -->
<!-- Web Site: http://www.altan.hr/snow -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! -->

<!-- Begin- hiệu ứng tuyết rơi - Sưu tầm và chỉnh sửa bởi
var no = 5; // Tốc độ tuyết rơi -
var speed = 50; // smaller number moves the snow faster
var snowflake = "http://file hinh.gif"; // tên file ảnh tuyết

var ns4up = (document.layers) ? 1 : 0; // browser sniffer
var ie4up = (document.all) ? 1 : 0;
var dx, xp, yp; // coordinate and position variables
var am, stx, sty; // amplitude and step variables
var i, doc_width = 200, doc_height = 800;
if (ns4up) {
doc_width = self.innerWidth;
doc_height = self.innerHeight;
} else if (ie4up) {
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
dx = new Array();
xp = new Array();
yp = new Array();
am = new Array();
stx = new Array();
sty = new Array();
for (i = 0; i < no; ++ i) {
dx[i] = 0; // set coordinate variables
xp[i] = Math.random()*(doc_width-50); // set position variables
yp[i] = Math.random()*doc_height;
am[i] = Math.random()*20; // set amplitude variables
stx[i] = 0.02 + Math.random()/10; // set step variables
sty[i] = 0.7 + Math.random(); // set step variables
if (ns4up) { // set layers
if (i == 0) {
document.write("<layer name=\"dot"+ i +"\" left=\"15\" ");
document.write("top=\"15\" visibility=\"show\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></layer>");
} else {
document.write("<layer name=\"dot"+ i +"\" left=\"15\" ");
document.write("top=\"15\" visibility=\"show\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></layer>");
}
} else if (ie4up) {
if (i == 0) {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
document.write("visible; TOP: 15px; LEFT: 15px;\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></div>");
} else {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
document.write("visible; TOP: 15px; LEFT: 15px;\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></div>");
}
}
}
function snowNS() { // Netscape main animation function
for (i = 0; i < no; ++ i) { // iterate for every dot
yp[i] += sty[i];
if (yp[i] > doc_height-50) {
xp[i] = Math.random()*(doc_width-am[i]-30);
yp[i] = 0;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
doc_width = self.innerWidth;
doc_height = self.innerHeight;
}
dx[i] += stx[i];
document.layers["dot"+i].top = yp[i];
document.layers["dot"+i].left = xp[i] + am[i]*Math.sin(dx[i]);
}
setTimeout("snowNS()", speed);
}
function snowIE() { // IE main animation function
for (i = 0; i < no; ++ i) { // iterate for every dot
yp[i] += sty[i];
if (yp[i] > doc_height-50) {
xp[i] = Math.random()*(doc_width-am[i]-30);
yp[i] = 0;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
dx[i] += stx[i];
document.all["dot"+i].style.pixelTop = yp[i];
document.all["dot"+i].style.pixelLeft = xp[i] + am[i]*Math.sin(dx[i]);
}
setTimeout("snowIE()", speed);
}
if (ns4up) {
snowNS();
} else if (ie4up) {
snowIE();
}
// End http://vuonsao.99k.org-->
</SCRIPT>
Tạo màu cho chuột:

Trích:
<script language="JavaScript">
//tao mau cho chuot ---
var a_Colour="red";
var b_Colour="blue";
var c_Colour="green";
var Size=50;


var YDummy=new Array(),XDummy=new Array(),xpos=0,ypos=0,ThisStep=0 ;step=0.03;
if (document.layers){
window.captureEvents(Event.MOUSEMOVE);
function nsMouse(evnt){
xpos = window.pageYOffset+evnt.pageX+6;
ypos = window.pageYOffset+evnt.pageY+16;
}
window.onMouseMove = nsMouse;
}
else if (document.all)
{
function ieMouse(){
xpos = document.body.scrollLeft+event.x+6;
ypos = document.body.scrollTop+event.y+16;
}
document.onmousemove = ieMouse;
}

function swirl(){
for (i = 0; i < 3; i++)
{
YDummy[i]=ypos+Size*Math.cos(ThisStep+i*2)*Math.sin((ThisSt ep)*6);
XDummy[i]=xpos+Size*Math.sin(ThisStep+i*2)*Math.sin((ThisSt ep)*6);
}
ThisStep+=step;
setTimeout('swirl()',10);
}

var amount=10;
if (document.layers){
for (i = 0; i < amount; i++)
{
document.write('<layer name=nsa'+i+' top=0 left=0 width='+i/2+' height='+i/2 +' bgcolor='+a_Colour+'></layer>');
document.write('<layer name=nsb'+i+' top=0 left=0 width='+i/2+' height='+i/2 +' bgcolor='+b_Colour+'></layer>');
document.write('<layer name=nsc'+i+' top=0 left=0 width='+i/2+' height='+i/2 +' bgcolor='+c_Colour+'></layer>');
}
}
else if (document.all){
document.write('<div id="ODiv" style="position:absolute;top:0px;left:0px">'
+'<div id="IDiv" style="position:relative">');
for (i = 0; i < amount; i++)
{
document.write('<div id=x style="position:absolute;top:0px;left:0px;width:'+ i/2 +';height:'+i/2+';background:'+a_Colour+';font-size:'+i/2+'"></div>');
document.write('<div id=y style="position:absolute;top:0px;left:0px;width:'+ i/2 +';height:'+i/2+';background:'+b_Colour+';font-size:'+i/2+'"></div>');
document.write('<div id=z style="position:absolute;top:0px;left:0px;width:'+ i/2 +';height:'+i/2+';background:'+c_Colour+';font-size:'+i/2+'"></div>');
}
document.write('</div></div>');
}
function prepos(){
var ntscp=document.layers;
var msie=document.all;
if (document.layers){
for (i = 0; i < amount; i++)
{
if (i < amount-1)
{
ntscp['nsa'+i].top=ntscp['nsa'+(i+1)].top;ntscp['nsa'+i].left=ntscp['nsa'+(i+1)]. left;
ntscp['nsb'+i].top=ntscp['nsb'+(i+1)].top;ntscp['nsb'+i].left=ntscp['nsb'+(i+1)]. left;
ntscp['nsc'+i].top=ntscp['nsc'+(i+1)].top;ntscp['nsc'+i].left=ntscp['nsc'+(i+1)]. left;
}
else
{
ntscp['nsa'+i].top=YDummy[0];ntscp['nsa'+i].left=XDummy[0];
ntscp['nsb'+i].top=YDummy[1];ntscp['nsb'+i].left=XDummy[1];
ntscp['nsc'+i].top=YDummy[2];ntscp['nsc'+i].left=XDummy[2];
}
}
}
else if (document.all){
for (i = 0; i < amount; i++)
{
if (i < amount-1)
{
msie.x[i].style.top=msie.x[i+1].style.top;msie.x[i].style.left=msie.x[i+1].style. left;
msie.y[i].style.top=msie.y[i+1].style.top;msie.y[i].style.left=msie.y[i+1].style. left;
msie.z[i].style.top=msie.z[i+1].style.top;msie.z[i].style.left=msie.z[i+1].style. left;
}
else
{
msie.x[i].style.top=YDummy[0];msie.x[i].style.left=XDummy[0];
msie.y[i].style.top=YDummy[1];msie.y[i].style.left=XDummy[1];
msie.z[i].style.top=YDummy[2];msie.z[i].style.left=XDummy[2];
}
}
}
setTimeout("prepos()",10);
}
function Start(){
swirl(),prepos()
}
window.onload=Start;
</script>
Chiếu sáng liên kết

Trích:
<STYLE>A:link {
COLOR: blue; TEXT-DECORATION: none
}
A:visited {
COLOR: blue; TEXT-DECORATION: none
}
A:active {
COLOR: white; BACKGROUND-COLOR: red; TEXT-DECORATION: none
}
A:hover {
COLOR: white; TEXT-DECORATION: none
}
A:hover {
BACKGROUND-COLOR: red; TEXT-DECORATION: none
}
</STYLE>
__________________
Click vào coi
hungarirang vẫn chưa có mặt trong diễn đàn   Trả Lời Với Trích Dẫn
Có 2 thành viên cảm ơn hungarirang cho bài viết này:
hoanggiang92 (04-07-2008), tranhuyhoangct2 (09-07-2008)
Old 04-07-2008, 20:05   #2
Rìu Sắt
 
hungarirang's Avatar
 
Tham gia: Feb 2008
Bài: 142
VZD: 2.796
Cảm ơn: 24
Điểm: 33/23 bài viết
Default

Chèn công cụ tìm kiếm Google Việt Nam lên Web

Trích:
<!-- Search Google -->
<center>
<form method="get" action="http://www.google.com.vn/custom" target="_top">
<table bgcolor="#ffffff">
<tr><td nowrap="nowrap" valign="top" align="left" height="32">
<a href="http://www.google.com/">
<img src="http://www.google.com/logos/Logo_25wht.gif" border="0" alt="Google" align="middle"></img></a>
<input type="text" name="q" size="50" maxlength="255" value=""></input>
<input type="submit" name="sa" value="Search"></input>
<input type="hidden" name="client" value="pub-1710694852538675"></input>
<input type="hidden" name="forid" value="1"></input>
<input type="hidden" name="ie" value="UTF-8"></input>
<input type="hidden" name="oe" value="UTF-8"></input>
<input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH :center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000F F;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1;"></input>
<input type="hidden" name="hl" value="vi"></input>
</td></tr></table>
</form>
</center>
<!-- Search Google -->
Đoạn mã Chat với Webmaster

Trích:
<a title="Gửi tin cho Webmaster qua Yahoo Chat" href="ymsgr:sendIM?Tên-nick-của-Bạn">
<img height="25" src="http://opi.yahoo.com/online?u=Tên-nick-Yahoo&m=g&t=2" width="125" border="0"></a>
__________________
Click vào coi
hungarirang vẫn chưa có mặt trong diễn đàn   Trả Lời Với Trích Dẫn
Old 04-07-2008, 20:06   #3
Rìu Bạc
 
nh0ck_cô đơn's Avatar
 
Tham gia: Apr 2008
Đến từ: nhà tù Chí Hòa
Bài: 342
VZD: 9.799
Cảm ơn: 76
Điểm: 171/79 bài viết
Default

cái này là cái ji` zậy bạn
__________________
vào blog mình tham quan đi http://nh0ckcon.co.cc
blog mình bao gồm hơn 1000 clip bài hát chất lượng cao bài nào cũng hay và hơn 1000 mẫu truyện cười
nh0ck_cô đơn vẫn chưa có mặt trong diễn đàn   Trả Lời Với Trích Dẫn
Old 04-07-2008, 20:07   #4
Rìu Vàng
 
thanhbv0710g's Avatar
 
Tham gia: Jun 2008
Đến từ: Gia Lâm
Bài: 859
VZD: 17.548
Cảm ơn: 80
Điểm: 662/327 bài viết
Default

Cái này là đoạn mã Java Script dùng để chèn vào WEB
thanhbv0710g vẫn chưa có mặt trong diễn đàn   Trả Lời Với Trích Dẫn
Thành viên đã cám ơn bài viết này của thanhbv0710g:
VN-Z0oM (09-07-2008)
Old 04-07-2008, 20:11   #5
Rìu Vàng
 
hoanggiang92's Avatar
 
Tham gia: Apr 2008
Bài: 941
VZD: 23.093
Cảm ơn: 389
Điểm: 713/327 bài viết
Default

rất tuyệt, còn gì bạn send nốt đi ! rất hay đấy
__________________
Chữ ký là gì ????
hoanggiang92 vẫn chưa có mặt trong diễn đàn   Trả Lời Với Trích Dẫn
Old 04-07-2008, 20:13   #6
Rìu Bạc Đôi
 
bingbongsong's Avatar
 
Tham gia: Apr 2008
Đến từ: TP Hồ Chí Minh
Bài: 586
VZD: 11.293
Cảm ơn: 95
Điểm: 250/142 bài viết
Send a message via MSN to bingbongsong Send a message via Yahoo to bingbongsong
Default

Zô đây koi một đống


Trang chuyên về javascript này tha hồ mà khám phá.
__________________

thay đổi nội dung bởi: bingbongsong, 04-07-2008 lúc 20:15.
bingbongsong đang trong diễn đàn   Trả Lời Với Trích Dẫn
Thành viên đã cám ơn bài viết này của bingbongsong:
hungarirang (18-07-2008)
Old 09-07-2008, 05:39   #7
Búa Gỗ Đôi
 
phantom1408's Avatar
 
Tham gia: Mar 2008
Bài: 32
VZD: 1.283
Cảm ơn: 51
Điểm: 15/7 bài viết
Default

PHP Code:
<MARQUEE style="Z-INDEX: 645; LEFT: 120px; WIDTH: 35px; POSITION: absolute; TOP: 50px; HEIGHT: 450px" scrollAmount=3 direction=down><IMG src="http://www.jellymuffin.com/generators/falling_objects/objects/hrt2b.gif"></MARQUEE>
<
MARQUEE style="Z-INDEX: 645; LEFT: 170px; WIDTH: 35px; POSITION: absolute; TOP: 70px; HEIGHT: 300px" scrollAmount=4 direction=down><IMG src="http://www.jellymuffin.com/generators/falling_objects/objects/hrt2b.gif"></MARQUEE>
<
MARQUEE style="Z-INDEX: 645; LEFT: 220px; WIDTH: 35px; POSITION: absolute; TOP: 90px; HEIGHT: 250px" scrollAmount=5 direction=down><IMG src="http://www.jellymuffin.com/generators/falling_objects/objects/hrt2b.gif"></MARQUEE>
<
MARQUEE style="Z-INDEX: 645; LEFT: 270px; WIDTH: 35px; POSITION: absolute; TOP: 30px; HEIGHT: 370px" direction=down><IMG src="http://www.jellymuffin.com/generators/falling_objects/objects/hrt2b.gif"></MARQUEE>
<
MARQUEE style="Z-INDEX: 645; LEFT: 320px; WIDTH: 35px; POSITION: absolute; TOP: 30px; HEIGHT: 340px" scrollAmount=7 direction=down><IMG src="http://www.jellymuffin.com/generators/falling_objects/objects/hrt2b.gif"></MARQUEE>
<
MARQUEE style="Z-INDEX: 645; LEFT: 240px; WIDTH: 35px; POSITION: absolute; TOP: 30px; HEIGHT: 70px" scrollAmount=2 direction=down><IMG src="http://www.jellymuffin.com/generators/falling_objects/objects/hrt2b.gif"></MARQUEE>
<
MARQUEE style="Z-INDEX: 645; LEFT: 140px; WIDTH: 35px; POSITION: absolute; TOP: 30px; HEIGHT: 50px" scrollAmount=3 direction=down><IMG src="http://www.jellymuffin.com/generators/falling_objects/objects/hrt2b.gif"></MARQUEE>
<
MARQUEE style="Z-INDEX: 645; LEFT: 290px; WIDTH: 35px; POSITION: absolute; TOP: 30px; HEIGHT: 60px" scrollAmount=2 direction=down><IMG src="http://www.jellymuffin.com/generators/falling_objects/objects/hrt2b.gif"></MARQUEE>
<
MARQUEE style="Z-INDEX: 645; LEFT: 100px; WIDTH: 35px; POSITION: absolute; TOP: 130px; HEIGHT: 80px" scrollAmount=3 direction=down></MARQUEE>
<
MARQUEE style="Z-INDEX: 645; LEFT: 360px; WIDTH: 35px; POSITION: absolute; TOP: 30px; HEIGHT: 330px" scrollAmount=2 direction=down><IMG src="http://www.jellymuffin.com/generators/falling_objects/objects/hrt2b.gif"></MARQUEE>
<
MARQUEE style="Z-INDEX: 645; LEFT: 390px; WIDTH: 35px; POSITION: absolute; TOP: 50px; HEIGHT: 400px" scrollAmount=3 direction=down><IMG src="http://www.jellymuffin.com/generators/falling_objects/objects/hrt2b.gif"></MARQUEE>
<
MARQUEE style="Z-INDEX: 600; LEFT: 440px; WIDTH: 35px; POSITION: absolute; TOP: 70px; HEIGHT: 300px" scrollAmount=4 direction=down><IMG src="http://www.jellymuffin.com/generators/falling_objects/objects/hrt2b.gif"></MARQUEE>
<
MARQUEE style="Z-INDEX: 645; LEFT: 470px; WIDTH: 35px; POSITION: absolute; TOP: 100px; HEIGHT: 300px" scrollAmount=2 direction=down><IMG src="http://www.jellymuffin.com/generators/falling_objects/objects/hrt2b.gif"></MARQUEE>
<
MARQUEE style="Z-INDEX: 645; LEFT: 560px; WIDTH: 35px; POSITION: absolute; TOP: 70px; HEIGHT: 300px" scrollAmount=4 direction=down><IMG src="http://www.jellymuffin.com/generators/falling_objects/objects/hrt2b.gif"></MARQUEE>

<
MARQUEE style="Z-INDEX: 645; LEFT: 590px; WIDTH: 35px; POSITION: absolute; TOP: 100px; HEIGHT: 300px" scrollAmount=2 direction=down><IMG src="http://www.jellymuffin.com/generators/falling_objects/objects/hrt2b.gif"></MARQUEE>
<
MARQUEE style="Z-INDEX: 645; LEFT: 520px; WIDTH: 35px; POSITION: absolute; TOP: 170px; HEIGHT: 300px" scrollAmount=4 direction=down><IMG src="http://www.jellymuffin.com/generators/falling_objects/objects/hrt2b.gif"></MARQUEE>
<
MARQUEE style="Z-INDEX: 645; LEFT: 610px; WIDTH: 35px; POSITION: absolute; TOP: 200px; HEIGHT: 300px" scrollAmount=2 direction=down><IMG src="http://www.jellymuffin.com/generators/falling_objects/objects/hrt2b.gif"></MARQUEE>
<
MARQUEE style="Z-INDEX: 645; LEFT: 650px; WIDTH: 35px; POSITION: absolute; TOP: 250px; HEIGHT: 340px" scrollAmount=3 direction=down><IMG src="http://www.jellymuffin.com/generators/falling_objects/objects/hrt2b.gif"></MARQUEE>
<
MARQUEE style="Z-INDEX: 645; LEFT: 690px; WIDTH: 35px; POSITION: absolute; TOP: 290px; HEIGHT: 380px" scrollAmount=2 direction=down><IMG src="http://www.jellymuffin.com/generators/falling_objects/objects/hrt2b.gif"></MARQUEE>
<
MARQUEE style="Z-INDEX: 645; LEFT: 660px; WIDTH: 35px; POSITION: absolute; TOP: 40px; HEIGHT: 70px" scrollAmount=3 direction=down><IMG src="http://www.jellymuffin.com/generators/falling_objects/objects/hrt2b.gif"></MARQUEE>
<
MARQUEE style="Z-INDEX: 645; LEFT: 690px; WIDTH: 35px; POSITION: absolute; TOP: 60px; HEIGHT: 90px" scrollAmount=2 direction=down><IMG src="http://www.jellymuffin.com/generators/falling_objects/objects/hrt2b.gif"></MARQUEE
__________________
Thà hôn em trước để bị em tát
Còn hơn nhìn thằng khác hôn em
phantom1408 vẫn chưa có mặt trong diễn đàn   Trả Lời Với Trích Dẫn
Thành viên đã cám ơn bài viết này của phantom1408:
hungarirang (22-08-2008)
Old 09-07-2008, 17:26   #8
Rìu Sắt
 
mchan004's Avatar
 
Tham gia: May 2008
Bài: 152
VZD: 2.860
Cảm ơn: 58
Điểm: 31/11 bài viết
Default

cho hỏi chèn vào phần nào có phải phần <head> kô
mchan004 vẫn chưa có mặt trong diễn đàn   Trả Lời Với Trích Dẫn
Old 09-07-2008, 18:18   #9
Rìu Sắt
 
hungarirang's Avatar
 
Tham gia: Feb 2008
Bài: 142
VZD: 2.796
Cảm ơn: 24
Điểm: 33/23 bài viết
Default

cậu chèn vào đâu, nếu file html thì cũng có thề, còn trong các teample của vbb thì khỏi
__________________
Click vào coi
hungarirang vẫn chưa có mặt trong diễn đàn   Trả Lời Với Trích Dẫn
Old 09-07-2008, 20:41   #10
Búa Đá
 
naenter's Avatar
 
Tham gia: Jun 2008
Bài: 51
VZD: 1.396
Cảm ơn: 6
Điểm: 0/0 bài viết
Default

xài đc chết liền !
naenter vẫn chưa có mặt trong diễn đàn   Trả Lời Với Trích Dẫn
Old 10-07-2008, 16:54   #11
Rìu Sắt
 
hungarirang's Avatar
 
Tham gia: Feb 2008
Bài: 142
VZD: 2.796
Cảm ơn: 24
Điểm: 33/23 bài viết
Default

nếu không xài đc thì ..... BT
__________________
Click vào coi
hungarirang vẫn chưa có mặt trong diễn đàn   Trả Lời Với Trích Dẫn
Old 02-08-2008, 10:01   #12
Rìu Sắt
 
khanh11121988's Avatar
 
Tham gia: Mar 2008
Bài: 161
VZD: 2.217
Cảm ơn: 8
Điểm: 42/30 bài viết
Default

chơi thế này thì......pó tay
khanh11121988 vẫn chưa có mặt trong diễn đàn   Trả Lời Với Trích Dẫn
Old 02-08-2008, 15:40   #13
Gà Con
 
superga321's Avatar
 
Tham gia: Aug 2008
Bài: 1
VZD: 147
Cảm ơn: 0
Điểm: 0/0 bài viết
Default

cái này từ thời lâu lắm rồi
superga321 vẫn chưa có mặt trong diễn đàn   Trả Lời Với Trích Dẫn
Trả lời

Ðiều Chỉnh
Xếp Bài

Quyền Sử Dụng Ở Diễn Ðàn
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is Mở
Smilies đang Mở
[IMG] đang Mở
HTML đang Tắt
Trackbacks are Tắt
Pingbacks are Tắt
Refbacks are Tắt
Chuyển đến


Múi giờ GMT +7. Hiện tại là 19:00.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
Từ điển được cung cấp bởi VDict.com - Hosting được tài trợ bởi Rao vặt 123