Bạn có muốn phản ứng với tin nhắn này? Vui lòng đăng ký diễn đàn trong một vài cú nhấp chuột hoặc đăng nhập để tiếp tục.

Tập hợp code cho web

Go down

Tập hợp code cho web Empty Tập hợp code cho web

Bài gửi by haanh Fri Dec 03, 2010 2:06 am

Từ Điển Tinh Vân

Bạn có muốn gắn mục tra cứu từ điển ngay trên trang web của mình, đây là dịch vụ từ điển miễn phí trực tuyến rất hay của TinhVân:
- Phần script:
Code:
<script LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
function Esc(inval, utf) {
inval = escape(inval);
if (utf == 0) {
return inval;
}
outval = "";
while (inval.length > 0) {
p = inval.indexOf("%");
copy Script phía dưới paste vào <head>

<script language="JavaScript">
<!-- Delayed Mouse Follow
var n4=(document.layers);
var n6=(document.getElementById&&!document.all);
var ie=(document.all);
var o6=(navigator.appName.indexOf("Opera") != -1)?true:false;

//Things to alter here..............................
var msg="Welcome to My Home Page
Copy code phía dưới paste vào bất kỳ chỗ nào

<script LANGUAGE="JavaScript">
ns = (document.layers)?1:0;
Clrs = new Array('ff0000','00ff00','ffffff','ff00ff','ffa500','ffff00','00ff00','ffffff','ff00ff')
yBase = 0;
xBase = 0;
step = 3;
currStep = 0;
Ypos = 0;
Xpos = 0;
if (ns){
for (i = 0; i < 14; i++)
document.write('<LAYER NAME="n'+i+'" ...


Tuyết Đang Rơi

Ở đây tôi mạn phép dùng ánh sao vì bông tuyết tôi không có, nếu bạn có bông tuyết cho vào, tất nhiên bông tuyết phải lớn hơn sao nhiều và thay nền đen thành nền trắng thì sẽ trở nên một trận Tuyết rơi rồi đó.
Các bạn hãy nhúng đoạn Java Script bên dưới vào trang web của bạn đồng thời kết hợp với 1 image. Mức độ tương thích trình duyệt rất tốt, nó có thể tương thích với cả 2 trình duyệt Internet Explorer & Netscape Navigator. Bạn hãy copy đoạn Java Script dán vào Notepad sau đó lưu lại thành file có đuôi .htm hoặc .html.

Các bạn lưu ý: Khi tạo 1 image này các bạn cần tạo image này càng nhẹ nhàng chừng nào thì bông tuyết gơi càng nhẹ nhàng và uyển chuyển chừng đó, image này phải đạt mức độ trong suốt, kích thước bức ảnh càng nhỏ thì càng đỡ phải che mất chữ của bạn.
Code:
<html>

<head>

<title>Hieu Ung JavaScript Tuyet Dang Roi - Le Hu'ng Homepage</title>

</head>

<body>

<center>
<script LANGUAGE="JavaScript1.2">

<!-- Begin

var no = 25; // Số tuyết

var speed = 10; // Số càng nhỏ tuyết di chuyển(rơi) càng nhanh

var snowflake = "images/idcs.gif"; // Nơi đây chèn hình bông tuyết

var ns4up = (document.layers) ? 1 : 0; // Bộ duyệt tìm nạp vào

var ie4up = (document.all) ? 1 : 0;

var dx, xp, yp; // tọa độ và những vị trí thay đổi

var am, stx, sty; // Độ rộng và những bước thay đổi

var i, doc_width = 800, doc_height = 600;

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; // những biến đổi toạ độ tập hợp

xp[i] = Math.random()*(doc_width-50); // tập hợp những thay đổi vị trí

yp[i] = Math.random()*doc_height;

am[i] = Math.random()*20; // tập hợp những thay đổi độ rộng

stx[i] = 0.02 + Math.random()/10; // tập hợp những thay đổi bước

sty[i] = 0.7 + Math.random(); //tập hợp những thay đổi bước

if (ns4up) { // những lớp tập hợp

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() { // hàm Netscape hoạt cảnh chính

for (i = 0; i < no; ++ i) { // vòng lặp cho mỗi điểm

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() { // hàm IE hoạt cảnh chính

for (i = 0; i < no; ++ i) { // vòng lặp cho mỗi điểm

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 -->

</script>
</body>

</html>

Hiệu Ứng Chuyển Trang

Chèn vào dưới thẻ <head> của web

Code:
<META http-equiv="Page-Enter" content="revealTrans(Duration=3.0,Transition=24)">
<META http-equiv="Site-Exit" content="revealTrans(Duration=3.0,Transition=24)">



1 / Trái tim bay từ dưới lên

demo : [You must be registered and logged in to see this link.]

Chèn script này sau thẻ <body>

Code:
<script language=javascript>Image0 = new Image();Image0.src = "http://ddhs.ca/forum/images/tim.gif";Amount = 20; Ymouse = -50;Xmouse = -50;Ypos = new Array();Xpos = new Array();Speed = new Array();rate = new Array();grow = new Array();Step = new Array();Cstep = new Array();nsSize = new Array();ns = (document.layers)?1:0;(document.layers)?window.captureEvents(Event.MOUSEMOVE):0;function Mouse(evnt) {Ymouse=(document.layers)?evnt.pageY-20:event.y-20;Xmouse=(document.layers)?evnt.pageX:event.x;}(document.layers)?window.onMouseMove=Mouse:document.onmousemove=Mouse;for (i = 0; i < Amount; i++) {Ypos[i] = Ymouse;Xpos[i] = Xmouse;Speed[i] = Math.random()*4+1;Cstep[i] = 0;Step[i] = Math.random()*0.1+0.05;grow[i] = 8;nsSize[i] = Math.random()*15+5;rate[i] = Math.random()*0.5+0.1;}if (ns) {for (i = 0; i < Amount; i++) {document.write("<LAYER NAME='sn"+i+"' LEFT=0 TOP=0><img src="+Image0.src+" name='N' width="+nsSize[i]+" height="+nsSize[i]+"></LAYER>"); � }}else {document.write('<div style="position:absolute;top:0px;left:0px"><div style="position:relative">');for (i = 0; i < Amount; i++) {document.write('<img id="si" src="'+Image0.src+'" style="position:absolute;top:0px;left:0px;filter:alpha(opacity=90)">');}document.write('</div></div>');}function MouseBubbles() {var hscrll = (document.layers)?window.pageYOffset:document.body.scrollTop;var wscrll = (document.layers)?window.pageXOffset:document.body.scrollLeft;for (i = 0; i < Amount; i++){sy = Speed[i] * Math.sin(270 * Math.PI / 180);sx = Speed[i] * Math.cos(Cstep[i] * 4);Ypos[i] += sy;Xpos[i] += sx; if (Ypos[i] < -40) {Ypos[i] = Ymouse;Xpos[i] = Xmouse;Speed[i] = Math.random() * 6 + 4;grow[i] = 5;nsSize[i] = Math.random() * 15 + 5;}if (ns) {document.layers['sn'+i].left = Xpos[i] + wscrll;document.layers['sn'+i].top = Ypos[i] + hscrll;}else {si[i].style.pixelLeft = Xpos[i] + wscrll;si[i].style.pixelTop = Ypos[i] + hscrll;si[i].style.width = grow[i];si[i].style.height = grow[i]; }grow[i] += rate[i]; Cstep[i] += Step[i];if (grow[i] > 15) grow[i] = 9;}setTimeout('MouseBubbles()', 50);}MouseBubbles();</SCRIPT>


sưu tầm
haanh
haanh
Admin
Admin

Giới tính Giới tính : Nam

Cancer Monkey
Tổng số bài gửi Tổng số bài gửi : 107
EXP EXP : 224
Thanks Thanks : 5
Tham gia Tham gia : 12/11/2010
Tuổi Tuổi : 32
Đến từ Đến từ : Thiên đường
Nick Yahoo Nick Yahoo : haanh0312

https://niitthainguyen.forumvi.net

Về Đầu Trang Go down

Về Đầu Trang

- Similar topics

 
Permissions in this forum:
Bạn không có quyền trả lời bài viết