Chữ ẩn hiện và thay đổi chữ<script LANGUAGE="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!!
http://thangbombh.sg.st -->
<!-- ThangBomBH,
thangbombh@thangbombh.zzn.com. -->
<!-- Begin
// add as many or as few messages as you would like
var msg=new Array()
msg[0]="<CENTER>Chao mung cac ban den voi ThangBomBH Homepages ...!</CENTER>";
msg[1]="<CENTER>...Chuc cac ban luon thanh dat va vui ve.</CENTER>";
msg[2]="<CENTER>Just type in \"<A href='http://thangbombh.sg.st/'>Thangbombh.sg.st</A>\"</CENTER>";
msg[3]="<CENTER>Cam on cac ban da ghe tham !</CENTER>";
// set your first set of colors. Use as many or as few as you wish.
var colors1=new Array("ffffff", "eeeeff", "ddddff", "ccccff", "bbbbff", "aaaaff", "9999ff",
"8888ff", "7777ff", "6666ff", "5555ff", "4444ff", "3333ff","2222ff", "1111ff", "0000ff")
//set your second set of colors
// *** must have exactly the same number of colors as the array above ***
var colors2=new Array("ffffff", "ffeeee", "ffdddd", "ffcccc", "ffbbbb", "ffaaaa", "ff9999",
"ff8888", "ff7777", "ff6666", "ff5555", "ff4444", "ff3333", "ff2222", "ff1111", "ff0000")
//set the height of the display in pixels
high=60;
//set the width of the display in pixels
wide=350;
//set the pixel coordinates for the upper left hand corner of the display
Xpos=220;
Ypos=180;
// move the display away from the edges of the background
pad=15;
// set the background color of the display
bgcol="ffffff";
//add a background image if you want.
// *** for no image, just leave empty quotes (ex. cellbg=""; ) ***
cellbg="faderbg.jpg";
// set the font
fntFam="verdana,helvetica,arial";
fntSize=14;
// set how how many seconds you want the message to stay remain at totality.
pause=2.5;
// Do not edit these values below!!!
icolor=0;
mcolor=1;
imsg=0;
spWidth=wide-(2*pad);
totality=false;
glowing=true;
var theMsg="";
var cellcontent="";
pause=pause*1000;
if(cellbg.length>4){cellbg=" background="+cellbg}
else{cellbg="";}
function doPause(){
totality=false; t=setTimeout("changecolor()",pause);
}
function initiate(){
getContentColor();
getMsg();
getCellContent();
if(document.all){
msgbg.innerHTML=cellcontent;
msgfade.innerHTML=theMsg;
msgbg.style.posLeft=Xpos;
msgbg.style.posTop=Ypos;
msgfade.style.posLeft=Xpos+pad;
msgfade.style.posTop=Ypos+pad;
t=setTimeout("changecolor()",50);}
if(document.layers){
document.msgbg.document.write(cellcontent);
document.msgbg.document.close();
document.msgfade.document.write(theMsg);
document.msgfade.document.close();
document.msgbg.left=Xpos;
document.msgbg.top=Ypos;
document.msgfade.left=Xpos+pad;
document.msgfade.top=Ypos+pad;
t=setTimeout("changecolor()",100);}
}
function changecolor(){
if(totality==true){doPause();}
else{
getMsg();
getContentColor();
if(document.all){
msgfade.innerHTML=theMsg;
t=setTimeout("changecolor()",50);}
if(document.layers){
document.msgfade.document.write(theMsg);
document.msgfade.document.close();
t=setTimeout("changecolor()",70);}
}
}
function getFadeColor(){
icolor=icolor-1;
if(mcolor==1){contentcolor=colors1[icolo
r];}
else{contentcolor=colors2[icolor];}
}
function getGlowColor(){
icolor=icolor+1;
if(mcolor==1){contentcolor=colors1[icolo
r];}
else{contentcolor=colors2[icolor];}
}
function changemsg(){
if(imsg==msg.length-1){imsg=0; mcolor=1;}
else if(imsg != msg.lenght-1 && mcolor==1){imsg=imsg+1; mcolor=0;}
else{imsg=imsg+1; mcolor=1;}
}
function getContentColor(){
if(icolor==colors1.length-1 && glowing==true){
getFadeColor(); glowing=false; totality=true;}
else if(icolor < colors1.length && glowing==true){
getGlowColor();}
else if(icolor < 1 && glowing==false){changemsg(); getGlowColor(); glowing=true;}
else{getFadeColor();}
}
function getMsg() {
theMsg="<span style='font-size:"+fntSize+"pt; font-family:"+fntFam+"; width:"+spWidth+";'>"
theMsg+="<B><font color="+contentcolor+">"+msg[imsg]+"</font></B> "
theMsg+="</span>"
}
function getCellContent(){
cellcontent="<TABLE height="+high+
" width="+wide+" bgcolor="+bgcol+" cellpadding=0 cellspacing=0><TR><TD"+cellbg+"> </TD></TR></TABLE>"}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Insert the onLoad event handler into your BODY tag -->
<BODY onLoad="initiate()">
<!-- STEP THREE: Copy this code into the BODY of your HTML document -->
<DIV id=msgbg style="position: absolute;"></DIV>
<DIV id=msgfade style="position: absolute;"></DIV>
<!-- Script Size: 5.17 KB -->
Link đổi màu tự động<script LANGUAGE="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!!
http://thangbombh.sg.st -->
<!-- Begin
function initArray() {
for (var i = 0; i < initArray.arguments.length; i++) {
this[i] = initArray.arguments[i];
}
this.length = initArray.arguments.length;
}
var colors = new initArray(
"red",
"blue",
"green",
"purple",
"black",
"tan",
"red");
delay = .5; // seconds
link = 0;
vlink = 2;
function linkDance() {
link = (link+1)%colors.length;
vlink = (vlink+1)%colors.length;
document.linkColor = colors[link];
document.vlinkColor = colors[vlink];
setTimeout("linkDance()",delay*1000);
}
linkDance();
// End -->
</script>
<p><a href="http://thangbombh.sg.st">Welcome to ThangBomBh Homepages !</a></p>
<!-- Be sure to include some links in your HTML page! -->
<!-- Script Size: 0.98 KB -->
Chữ vòng quanh theo con trỏ<script LANGUAGE="JavaScript">
<!-- Original: ThangBomBH (thangbom_bh@yahoo.com) -->
<!-- Web Site:
http://thangbombh.sg.st -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!!
http://thangbombh.sg.st -->
<!-- Begin
if (document.all) {
//Things you can alter
yourLogo = "Welcome to ThangBomBH Homepages !"; //Not less than 2 letters!
logoFont = "Arial";
logoColor = "000000";
//Nothing needs altering below!
yourLogo = yourLogo.split('');
L = yourLogo.length;
TrigSplit = 360 / L;
Sz = new Array()
logoWidth = 100;
logoHeight = -30;
ypos = 0;
xpos = 0;
step = 0.03;
currStep = 0;
document.write('<div id="outer" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i = 0; i < L; i++) {
document.write('<div id="ie" style=& quot;position:absolute;top:0px;left:0px;
'
+'width:10px;height:10px;font-family:'+logoFont+';font-size:12px;'
+'color:'+logoColor+';text-align:center">'+yourLogo[i]+'</div>');
}
document.write('</div></div>');
function Mouse() {
ypos = event.y;
xpos = event.x - 5;
}
document.onmousemove=Mouse;
function animateLogo() {
outer.style.pixelTop = document.body.scrollTop;
for (i = 0; i < L; i++) {
ie[i].style.top = ypos + logoHeight * Math.sin(currStep + i * TrigSplit * Math.PI / 180);
ie[i].style.left = xpos + logoWidth * Math.cos(currStep + i * TrigSplit * Math.PI / 180);
Sz[i] = ie[i].style.pixelTop - ypos;
if (Sz[i] < 5) Sz[i] = 5;
ie[i].style.fontSize = Sz[i] / 1.7;
}
currStep -= step;
setTimeout('animateLogo()', 20);
}
window.onload = animateLogo;
}
// End -->
</script>
<!-- Script Size: 1.93 KB -->
Chữ chạy theo con trỏ, chữ này có bóng<script LANGUAGE="JavaScript">
<!-- Original: ThangBomBH (thangbom_bh@yahoo.com) -->
<!-- Web Site:
http://thangbombh.sg.st -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!!
http://thangbombh.sg.st -->
<!-- Begin
message = 'Welcome to ThangBomBH Homepages !';
FonT = 'Verdana';
ColoR = '999999';
SizE = 3; //1 to 7 only!
var amount = 5, ypos =- 50, xpos = 0, Ay = 0, Ax = 0, By = 0, Bx = 0, Cy = 0, Cx = 0, Dy = 0, Dx = 0, Ey = 0, Ex = 0;
if (document.layers) {
for (i = 0; i < amount; i++) {
document.write('<layer name=nsl'+i+' top=0 left=0><font face='+FonT+' size='+SizE+' color='+ColoR+'>'+message+'</font></layer>');
}
window.captureEvents(Event.MOUSEMOVE);
function nsmouse(evnt) {
xpos = evnt.pageX + 20;
ypos = evnt.pageY + 20;
}
window.onMouseMove = nsmouse;
}
else if (document.all) {
document.write("<div id='outer' style='position:absolute;top:0px;left:0px'>");
document.write("<div style='position:relative'>");
for (i = 0; i < amount; i++) {
document.write('<div id="text"'+i+' style=& quot;position:absolute;top:0px;left:0px;
width:400px;height:20px"><font face='+FonT+' size='+SizE+' color='+ColoR+'>'+message+'</font></div>')
}
document.write("</div>");
document.write("</div>");
function iemouse() {
ypos = event.y + 20;
xpos = event.x + 20;
}
window.document.onmousemove = iemouse;
}
function makefollow() {
if (document.layers) {
document.layers['nsl'+0].top = ay;
document.layers['nsl'+0].left = ax;
document.layers['nsl'+1].top = by;
document.layers['nsl'+1].left = bx;
document.layers['nsl'+2].top = cy;
document.layers['nsl'+2].left = cx;
document.layers['nsl'+3].top = Dy;
document.layers['nsl'+3].left = Dx;
document.layers['nsl'+4].top = Ey;
document.layers['nsl'+4].left = Ex;
}
else if (document.all) {
outer.style.pixelTop = document.body.scrollTop;
text[0].style.pixelTop = ay;
text[0].style.pixelLeft = ax;
text[1].style.pixelTop = by;
text[1].style.pixelLeft = bx;
text[2].style.pixelTop = cy;
text[2].style.pixelLeft = cx;
text[3].style.pixelTop = Dy;
text[3].style.pixelLeft = Dx;
text[4].style.pixelTop = Ey;
text[4].style.pixelLeft = Ex;
}
}
function move() {
ey = Ey += (ypos - Ey) * 0.2;
ex = Ex += (xpos - Ex) * 0.2;
dy = Dy += (ey - Dy) * 0.3;
dx = Dx += (ex - Dx) * 0.3;
cy = Cy += (dy - Cy) * 0.4;
cx = Cx += (dx - Cx) * 0.4;
by = By += (cy - By) * 0.5;
bx = Bx += (cx - Bx) * 0.5;
ay = Ay += (by - Ay) * 0.6;
ax = Ax += (bx - Ax) * 0.6;
makefollow();
setTimeout('move()', 10);
}
window.onload=move;
// End -->
</script>
<!-- Script Size: 2.91 KB -->
Chuỗi các ngôi sao bay theo MouseChú ý : Cần ảnh 6 ngôi sao , đặt nó trong 1 thư mục có tên là Images, bên ngoài thư mục đó là trang web có chứa đoạn mã bên dưới<HTML>
<HEAD>
<TITLE>Hieu u'ng JavaScript - Le Quang Anh Hu'ng</TITLE>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=x-user-defined">
<META content="Microsoft FrontPage 4.0" name=GENERATOR>
<META content="Le Quang Anh Hu'ng Homepage" name=Author>
<script language=JavaScript>
<!--Che dấu những trình duyệt mà không biết JavaScript (ở đây sử dụng câu lệnh If và else if)
var version = 0;
if (navigator.userAgent.indexOf("MSIE 4") != -1) version = 5;
else if (navigator.userAgent.indexOf("MSIE 3") != -1) version = 1;
else if (navigator.userAgent.indexOf("Mozilla/4") != -1) version = 4;
else if (navigator.userAgent.indexOf("Mozilla/4.5") != -1) version = 7;
else if (navigator.userAgent.indexOf("Mozilla/3") != -1) version = 3;
else if (navigator.userAgent.indexOf("Mozilla/2") != -1) version = 2;
else if (navigator.userAgent.indexOf("MSIE 4.5") != -1) version = 6;
else version = 8;
// -->
</SCRIPT>
<STYLE> <!-- Nơi đây dùng để tạo mẫu kích thước, vị trí cho Images(6 ngôi sao)--> #trailsprite1 {
HEIGHT: 10px; LEFT: 0px; POSITION: absolute; TOP: 1px; VISIBILITY: visible; WIDTH: 10px; Z-INDEX: 100
}
#trailsprite2 {
HEIGHT: 10px; LEFT: 0px; POSITION: absolute; TOP: 0px; VISIBILITY: visible; WIDTH: 10px; Z-INDEX: 10
}
#trailsprite3 {
HEIGHT: 10px; LEFT: 0px; POSITION: absolute; TOP: 0px; VISIBILITY: visible; WIDTH: 10px; Z-INDEX: 10
}
#trailsprite4 {
HEIGHT: 10px; LEFT: 0px; POSITION: absolute; TOP: 0px; VISIBILITY: visible; WIDTH: 10px; Z-INDEX: 10
}
#trailsprite5 {
HEIGHT: 10px; LEFT: 0px; POSITION: absolute; TOP: 0px; VISIBILITY: visible; WIDTH: 10px; Z-INDEX: 10
}
#trailsprite6 {
HEIGHT: 10px; LEFT: 0px; POSITION: absolute; TOP: 0px; VISIBILITY: visible; WIDTH: 10px; Z-INDEX: 10
}
</STYLE>
</HEAD>
<BODY bgColor=#000000> <!-- chỉ màu nền background color -->
<script language=JavaScript1.1>
if (version > 3) <!-- Nếu ver > 3 (JavaScript) khi đó sẽ xuất ra màn hình bức ảnh thứ 1 và thứ tự tiếp theo ứng với mỗi images bao gồm chiều cao, viền, tên, Id -->
document.write('<div id="trailSprite1"><img src="http://www.vn-zoom.com/images/trailgif1.gif"height="10"width="10"border="0"name= "trailSprite1img"></div><div id="trailSprite2"><img src="http://www.vn-zoom.com/images/trailgif2.gif"height="10"width="10"border="0"name= "trailSprite2img"></div><div id="trailSprite3"><img src="http://www.vn-zoom.com/images/trailgif3.gif"height="10"width="10"border="0"name= "trailSprite3img"></div><div id="trailSprite4"><img src="http://www.vn-zoom.com/images/trailgif4.gif"height="10"width="10"border="0"name= "trailSprite4img"></div><div id="trailSprite5"><img src="http://www.vn-zoom.com/images/trailgif5.gif"height="10"width="10"border="0"name= "trailSprite5img"></div><div id="trailSprite6"><img src="http://www.vn-zoom.com/images/trailgif6.gif"height="10"width="10"border="0"name= "trailSprite6img"></div>')
</SCRIPT>
<script language=JavaScript> <!-- Nơi dòng lệnh này hỗ trợ cho trình duyệt Netscape không có cũng chẳng sao -->
<!--
NS4 = (("Netscape"==navigator.appName) && ("4"<=parseInt(navigator.appVersion)))
window.name = "right" <!-- Bạn phải cẩn thận ngay chổ chữ "right" đây là chỗ nguy hiểm chết người nếu bạn không để ý frames của bạn sẽ sổ tầm bậy liền đó, chính vì vậy bạn ấn định để sổ frames tên gì thì phải đặt tên đó à nghe! -->
// -->
</SCRIPT>
<script language=Javascript1.1>
<!--
var isNS = (navigator.appName == "Netscape");
layerRef = (isNS) ? "document" : "document.all";
styleRef = (isNS) ? "" : ".style";
var queue = new Array();var NUM_OF_TRAIL_PARTS = 6
for (x=1; x < 7; x++)
{ ///////////////Image Preload
eval("trailSpriteFrame" + x + "=new Image(10,10);");
eval("trailSpriteFrame" + x + ".src='images/trailgif"+x+".gif';");
}////////////////////////////////////////////////Đối tượng vệt ngôi sao chạy theo mouse
function trailSpriteObj(anID)
{
this.trailSpriteID = "trailSprite" + anID; //Tùy đằng trước
this.imgRef = "trailSprite" + anID + "img"; //Chuyển tới tên những ngôi sau
this.currentFrame = 1; //nhìn thấy khung
this.animateTrailSprite = animateTrailSprite; //Khai báo phương pháp vòng lặp đối tượng
}
function animateTrailSprite()
{
if (this.currentFrame <7)
{// Nếu có hoạt cảnh (mà) những khung rời bỏ, thay đổi những ngôi sao kết cấu hiện thời
if (isNS)
{ //Phát hiện ra bộ duyệt và thực hiện sự chuyển đổi hình ảnh
eval("document['"+this.imgRef+"'].src=trailSpriteFrame" + this.currentFrame + ".src");
}
else
{
eval("document['"+this.imgRef+"'].src=trailSpriteFrame" + this.currentFrame + ".src");
}
this.currentFrame ++; //và tăng thêm hiện thời những đối tượng hình ảnh
}
else
{ //Khung hiện hành như vậy đạt đến giới hạn nó che dấu ngôi sao
eval(layerRef + '.' + this.trailSpriteID + styleRef + '.visibility="hidden"');
}
}/////////////////////////////////////////////////////////////////
function processAnim()
{
for(x=0; x < NUM_OF_TRAIL_PARTS; x++)
queue[x].animateTrailSprite();
}
function processMouse(e)
{
currentObj = shuffleQueue();
if (isNS)
{
eval("document." + currentObj + ".left=e.pageX-0;");
eval("document." + currentObj + ".top=e.pageY+5;");
}
else
{
eval("document.all." + currentObj + ".style.pixelLeft=event.clientX+document.body.scro llLeft-0;");
eval("document.all." + currentObj + ".style.pixelTop=event.clientY+document.body.scrol lTop+5;");
}
}
function shuffleQueue()
{
lastItemPos = queue.length - 1;
lastItem = queue[lastItemPos];
for (i = lastItemPos; i>0; i--)
queue[i] = queue[i-1];
queue[0] = lastItem;
queue[0].currentFrame = 1; //sự sắp đặt lại số thứ tự hình ảnh của những đối tượng & làm cho ngôi sao rõ ràng thêm
eval(layerRef + '.' + queue[0].trailSpriteID + styleRef + '.visibility="visible"');
return queue[0].trailSpriteID;
}
function init()
{
for(x=0; x<NUM_OF_TRAIL_PARTS; x++) //Sắp hàng đầy đủ vệt dài của đối tượng
queue[x] = new trailSpriteObj(x+1);
if (isNS)
{
document.captureEvents(Event.MOUSEMOVE);
}
document.onmousemove = processMouse;
setInterval("processAnim();",25);
}
if (version > 3)
window.onload = init;
// -->
</SCRIPT>
</body>
</html>