The World Of Entertainment
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.
The World Of Entertainment

WellCome To Light Heart The World Of Entertainment
 
Trang ChínhTrang Chính  Latest imagesLatest images  Tìm kiếmTìm kiếm  Đăng kýĐăng ký  Đăng Nhập  

 

 một số đoạn code hay

Go down 
Tác giảThông điệp
soledad
Admin
soledad


Nam Tổng số bài gửi : 60
Age : 35
Registration date : 18/10/2008

một số đoạn code hay Empty
Bài gửiTiêu đề: một số đoạn code hay   một số đoạn code hay EmptyTue Nov 11, 2008 4:25 pm

2. code về ảnh chạy từ dưới lên trên
Code:
<MARQUEE onMouseOver="this.stop()" onMouseOut="this.start()" scrolldelay="100" scrollamount="5" height="186" direction="up" width="166">
<A href="link ảnh" target="_blank"><IMG src="link ảnh" width="163"border="2"></A>
............
</MARQUEE>
nếu muốn ảnh chạy từ trên xuống hay từ trái qua phải,từ phải qua trái thì đổi chữ "up" thành "down" hay "right" hay "left" là đc.
3. Đưa biểu tượng yahoo vào web.
Code:
<a href="ymsgr:sendim?soledad_100389">
<img height="130" src="http://opi.yahoo.com/online?u=soledad_100389&m=g&t=11&1=us" width="150" border="0" align="left"></a></td>
<td align="center">
4. code ngày tháng chạy thanh dưới (kèm theo lời chào)
Code:
script language="JavaScript">
<!--
// Store the date In avarlable
d = new Date()
dateText = ""
// Get the cuurent day and convert it to the name of the day
dayValue = d.getDay()
if(dayValue == 0)
dateText += "Chủ Nhật"
else if (dayValue == 1)
dateText += "Thứ hai"
else if (dayValue == 2)
dateText += "Thứ Ba"
else if (dayValue == 3)
dateText += "Thứ Tư"
else if (dayValue == 4)
dateText += "Thứ Năm"
else if (dayValue == 5)
dateText += "Thứ Sáu"
else if (dayValue == 6)
dateText += "Thứ Bảy"
// Get the current date; if it's before 2000,add 1900
dateText += ", Ngày " + d.getDate()
// lấy tháng hiện tại và chuyển nó sang tháng theo tiếng Việt Nam
monthValue = d.getMonth()
dateText += " "
if (monthValue == 0)
dateText += "Tháng 1"
if (monthValue == 1)
dateText += "Tháng 2"
if (monthValue == 2)
dateText += "Tháng 3"
if (monthValue == 3)
dateText += "Tháng 4­"
if (monthValue == 4)
dateText += "Tháng 5"
if (monthValue == 5)
dateText += "Tháng 6"
if (monthValue == 6)
dateText += "Tháng 7"
if (monthValue == 7)
dateText += "Tháng 8"
if (monthValue == 8)
dateText += "Tháng 9"
if (monthValue == 9)
dateText += "Tháng 10"
if (monthValue == 10)
dateText += "Tháng 11"
if (monthValue == 11)
dateText += "Tháng 12"
// Get the current year; if it's before 2000, add 1900
if (d.getYear() < 2000)
dateText += ", Năm " + (1900 + d.getYear())
else
dateText += ", Năm " + (d.getYear())
// Get the current minutes
minuteValue = d.getMinutes()
if (minuteValue < 10)
minuteValue = "0" + minuteValue
// Get the current hours
hourValue = d.getHours()
// Customize the greeting based on the current hours
if (hourValue >=5 && hourValue <= 10)
{

timeText =  " Chào buổi sáng và chúc một ngày tốt lành"
}
else if (hourValue > 10 && hourValue <= 12)
{

timeText =  " Chào buổi trưa - Bạn ăn cơm chưa vậy ?"
}
else if (hourValue >= 13 && hourValue <17)
{

timeText = " Chào buổi chiều "
}
else if (hourValue >=17 && hourValue <18)
{
timeText = " Chào buổi chiều - Chắc là bạn ăn cơm rồi nhỉ ?"
}
else if (hourValue >=18 && hourValue<21)
{

timeText =  " Chào buổi tối"
}
else if( hourValue >=21 && hourValue <=24)
{
timeText =  "  Chúc bạn ngủ ngon và có giấc mơ đẹp"
}
else if(hourValue >=1 && hourValue <5 )
{
timeText = "Bạn dậy sớm quá vậy?Hại sức khỏe lắm.Chúc một ngày vui vẻ"
}

// Write the greeting, the date, and the time to the page
document.write(  dateText + "." + timeText + ".")
//http://thantoc.blogspot.com
-->
</script>
5. code chèn quảng cáo ở 2 bên trái phải
Code:

<DIV id="divAdLeft" align="left" style="LEFT: -95px; WIDTH: 108px; POSITION: absolute; TOP: 71px"><img src="http://gdty.info/ads/quangcao.jpg" border="0" width="110"><br/><a target="_blank" href="http://gdty.info/forum/ads.php?do=redirect&bannerid=7"><img src="http://gdty.info/ads/vuicungTrieuHoang.gif" border="0" width="110"></a><br/></DIV>
<DIV id="divAdRight" align="right" style="RIGHT: 1px; WIDTH: 115px; POSITION: absolute; TOP: 71px"><a target="_blank" href="http://www.loveringonline.com"><img src="http://gdty.info/ads/loveringgdty110.jpg" border="0" width="110"></a><br/><a target="_blank" href="http://gdty.info/forum/ads.php?do=redirect&bannerid=8"><img src="http://gdty.info/ads/mkitech_ads.jpg" border="0" width="110"></a><br/><!--<a target="_blank" href="http://gdty.info/forum/ads.php?do=redirect&bannerid=2"><img src="http://gdty.info/ads/truongthanh.gif" border="0" width="110"></a>--><br/>
</DIV>
<script src="http://www.freewebs.com/lamdaitrochuyen/quangcao.ibf"></script>
6. code dòng chữ chạy phía dưới banner
Code:

<body id="page_bg">
<a name="up" id="up"></a>
<div class="center" align="center">
<div id="wrapper">
<div id="wrapper_r">

<div id="whitebox">
<div id="whitebox_t">
<div id="whitebox_tl">
<div id="whitebox_tr">
[b]<marquee> Dong chu can chay</marquee>[/b]
<jdoc:include type="module" name="breadcrumbs" />

</div>
</div>
</div>
7.code chữ chạy trên thanh tiêu đề (hay lắm)
Code:

<script language="JavaScript" type="text/javascript">
var txt=".:: Chào Mừng Bạn Đến Với Trường ĐH Thủy Lợi CS 2 ::.";
var espera=200;
var refresco=null;
function rotulo_title() {
document.title=txt;
txt=txt.substring(1,txt.length)+txt.charAt(0);
refresco=setTimeout("rotulo_title()",espera);
}
rotulo_title();
</script>
8. Không Cho Click Chuột Phải ...
Code:

<SCRIPT language=JavaScript1.1>
function right(e) {
if (navigator.appName == 'Netscape' &&
(e.which == 3 || e.which == 2))
return false;
else if (navigator.appName == 'Microsoft Internet Explorer' &&
(event.button == 2 || event.button == 3)) {
alert('Chuc Mot Ngay Vui ve - Gui Wedsite Cho Ban Be Cua Minh Nha !');
return false;
}
return true;
}
document.onmousedown=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
window.onmousedown=right;
</SCRIPT>
9. chèn chuột vào web
Code:
<style type="text/css">
body {cursor: url(duong_dan_cua_con_tro_chuot_muon_chen.ani); }
</style>
10. Một hiệu ứng đẹp dành cho dong Title
Code:

<script language=javascript >
title_tmp1=document.title
if (title_tmp1.indexOf(">>")!=-1){
    title_tmp2=title_tmp1.split(">>");
    title_last="*~*"+title_tmp2[1];
    title_last=title_last + "*~*" + title_tmp2[2];
}else{

    if (title_tmp1.indexOf("*~*")!=-1){
    title_tmp2=title_tmp1.split("*~*");
    title_last="*~*"+title_tmp2[1];
        if (title_last=="*~*"){title_last="*~*"};
        if (title_last=="*~*"){title_last="*~*"};
    }
    else {    title_last="TrangLong - Http://TrangLong.Net"}
    }
title_new=""+title_last+""
step=0
function flash_title()
    {
      step++
      if (step==8) {step=1}
      if (step==1) {document.title='[---*'+title_new+'*---]'}
      if (step==2) {document.title='[--*-'+title_new+'-*--]'}
      if (step==3) {document.title='[-*--'+title_new+'--*-]'}
      if (step==4) {document.title='[*---'+title_new+'---*]'}
  if (step==5) {document.title='[-*--'+title_new+'--*-]'}
  if (step==6) {document.title='[--*-'+title_new+'-*--]'}
  if (step==7) {document.title='[---*'+title_new+'*---]'}
      setTimeout("flash_title()",180);
    }
flash_title()
</script>
Về Đầu Trang Go down
http://www.soledad.come.vn
soledad
Admin
soledad


Nam Tổng số bài gửi : 60
Age : 35
Registration date : 18/10/2008

một số đoạn code hay Empty
Bài gửiTiêu đề: tiep   một số đoạn code hay EmptyTue Nov 11, 2008 4:26 pm

11. tạo hồ cá
Code:
<body background="fish.jpg" onload=pagestart(); onunload="if(brOK) {stopme('chip1'); stopme('chip2'); stopme('chip3');}">
<SCRIPT language=JavaScript>
<!-- bat dau doan js bong bong bay len
Image0=new Image();
Image0.src="bongbong.gif";
Amount=15; //so luong bong bong

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;
WinHeight=(document.layers)?window.innerHeight:win dow.document.body.clientHeight;
WinWidth=(document.layers)?window.innerWidth:windo w.document.body.clientWidth;
for (i=0; i < Amount; i++){
Ypos[i] = Math.round(Math.random()*WinHeight);
Xpos[i] = Math.round(Math.random()*WinWidth);
Speed[i]= Math.random()*4+4;
Cstep[i]=0;
Step[i]=Math.random()*0.1+0.05;
grow[i]=10;
nsSize[i]=Math.random()*15+5;
}
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:a lpha(opacity=60)">');
}
document.write('</div></div>');
}
function bubbles(){
var WinHeight=(document.layers)?window.innerHeight:win dow.document.body.clientHeight;
var WinWidth=(document.layers)?window.innerWidth:windo w.document.body.clientWidth;
var hscrll=(document.layers)?window.pageYOffset:docume nt.body.scrollTop;
var wscrll=(document.layers)?window.pageXOffset:docume nt.body.scrollLeft;
for (i=0; i < Amount; i++){
sy = Speed[i]*Math.sin(270*Math.PI/180);
sx = Speed[i]*Math.cos(Cstep[i]);
Ypos[i]+=sy;
Xpos[i]+=sx;
rate[i]=0.4;
if (Ypos[i] < -50){
Ypos[i]=WinHeight+50;
Xpos[i]=Math.round(Math.random()*WinWidth);
Speed[i]=Math.random()*4+6;

grow[i]=2;
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] > 24) grow[i]=25;
}
setTimeout('bubbles()',10);
}
bubbles();
//-->
</SCRIPT>
phân2
Phia duoi la bat dau js ca boi- nho them cac thong so trong the bodyDay la doan js bong bong bay trong site da duoc gioi thieu tren echip Mr - Hot
mi`nh da doi tha`nh anh ba con ca'
<SCRIPT language=JavaScript>
var brOK=false;
var mie=false;
var aver=parseInt(navigator.appVersion.substring(0,1)) ;
var aname=navigator.appName;
function checkbrOK()
{if(aname.indexOf("Internet Explorer")!=-1)
{if(aver>=4) brOK=navigator.javaEnabled();
mie=true;
}
if(aname.indexOf("Netscape")!=-1)
{if(aver>=4) brOK=navigator.javaEnabled();}
}
var vmin=2;
var vmax=5;
var vr=2;
var timer1;
function Chip(chipname,width,height)
{this.named=chipname;
this.vx=vmin+vmax*Math.random();
this.vy=vmin+vmax*Math.random();
this.w=width;
this.h=height;
this.xx=0;
this.yy=0;
this.timer1=null;
}
function movechip(chipname)
{
if(brOK)
{eval("chip="+chipname);
if(!mie)
{pageX=window.pageXOffset;
pageW=window.innerWidth;
pageY=window.pageYOffset;
pageH=window.innerHeight;
}
else
{pageX=window.document.body.scrollLeft;
pageW=window.document.body.offsetWidth-8;
pageY=window.document.body.scrollTop;
pageH=window.document.body.offsetHeight;
}
chip.xx=chip.xx+chip.vx;
chip.yy=chip.yy+chip.vy;
chip.vx+=vr*(Math.random()-0.5);
chip.vy+=vr*(Math.random()-0.5);
if(chip.vx>(vmax+vmin)) chip.vx=(vmax+vmin)*2-chip.vx;
if(chip.vx<(-vmax-vmin)) chip.vx=(-vmax-vmin)*2-chip.vx;
if(chip.vy>(vmax+vmin)) chip.vy=(vmax+vmin)*2-chip.vy;
if(chip.vy<(-vmax-vmin)) chip.vy=(-vmax-vmin)*2-chip.vy;
if(chip.xx<=pageX)
{chip.xx=pageX;
chip.vx=vmin+vmax*Math.random();
}
if(chip.xx>=pageX+pageW-chip.w)
{chip.xx=pageX+pageW-chip.w;
chip.vx=-vmin-vmax*Math.random();
}
if(chip.yy<=pageY)
{chip.yy=pageY;
chip.vy=vmin+vmax*Math.random();
}
if(chip.yy>=pageY+pageH-chip.h)
{chip.yy=pageY+pageH-chip.h;
chip.vy=-vmin-vmax*Math.random();
}
if(!mie)
{eval('document.'+chip.named+'.top ='+chip.yy);
eval('document.'+chip.named+'.left='+chip.xx);
}
else
{eval('document.all.'+chip.named+'.style.pixelLeft ='+chip.xx);
eval('document.all.'+chip.named+'.style.pixelTop ='+chip.yy);
}
chip.timer1=setTimeout("movechip('"+chip.named+"') ",100);
}
}
function stopme(chipname)
{if(brOK)
{//alert(chipname)
eval("chip="+chipname);
if(chip.timer1!=null)
{clearTimeout(chip.timer1)}
}
}
</SCRIPT>
<SCRIPT>
var chip1;
var chip2;
var chip3;
function pagestart()
{checkbrOK();
chip1=new Chip("chip1",60,80);
chip2=new Chip("chip2",60,80);
chip3=new Chip("chip3",60,80);
if(brOK)
{ movechip("chip1");
movechip("chip2");
movechip("chip3");
}
}
</SCRIPT>
<DIV id=chip1 style="HEIGHT: 68px; POSITION: absolute; WIDTH: 47px">
<DD>
<P align=left>
<IMG border=0 height=108 src="ca2.gif" width=47> <!anh con ca do>
</P></DD></DIV>
<DIV id=chip2 style="HEIGHT: 88px; POSITION: absolute; WIDTH: 67px"> <DD>
<IMG border=0 height=120 src="ca.gif" width=120> <!anh con ca xanh>
</DD> </DIV>
<DIV id=chip3 style="HEIGHT: 68px; POSITION: absolute; WIDTH: 47px">
<DD><IMG border=0 height=68 src="ca2.gif" width=47> <!anh con ca do>
</DD></DIV>
12.đổi màu thanh cuộn
Code:

<STYLE type=text/css>
BODY {
SCROLLBAR-FACE-COLOR: blue; //nen cua nut (tren, duoi), mau nut cuon
SCROLLBAR-HIGHLIGHT-COLOR: silver; //
SCROLLBAR-SHADOW-COLOR: white; // Vien cua nut
SCROLLBAR-ARROW-COLOR: yellow;
SCROLLBAR-TRACK-COLOR: green; // than thanh cuon
SCROLLBAR-BASE-COLOR: black;
scrollbar-dark-shadow-color: yellow;
scrollbar-3d-light-color: red;
}
</STYLE>
13. Hiệu Ứng Chuyển Trang
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)">
Về Đầu Trang Go down
http://www.soledad.come.vn
 
một số đoạn code hay
Về Đầu Trang 
Trang 1 trong tổng số 1 trang
 Similar topics
-
» tổng hợp code cho web

Permissions in this forum:Bạn không có quyền trả lời bài viết
The World Of Entertainment :: CLB Tin Học :: Thiết Kế Web :: Thiết Kế Web Dạng HTML-
Chuyển đến