- Bước 1: vào mục Mẫu >> Chỉnh sửa HTML
Thêm đoạn code sau vào trước thẻ </body> (Để vào sau <head> cũng được nhưng nên để code cuối trang vì ta sẽ để load sau cùng):
<style type='text/css'>
#bttop{
border:1px solid
#4adcff;background:
#24bde2;text-align:center;padding:5px;position:fixed;bottom:35px;right:10px;cursor:pointer;display:none;color:
#fff;font-size:11px;font-weight:900;line-height: 25px;
}
#bttop:hover{border:1px solid #32cd32;background:#bada55;
}
</style>
<div id='bttop'>BACK TO TOP</div>
<script src='https://backlinkjs.googlecode.com/files/min.js' type='text/javascript'></script>
<script type='text/javascript'>$(function(){$(window).scroll(function(){
if($(this).scrollTop()!=0){
$('#bttop').fadeIn();
}else{$('#bttop').fadeOut();
}
});
$('#bttop').click(function(){
$('body,html').animate({scrollTop:0},800);
});
});
</script>
Chú ý: Ở giữa 2 thẻ <style type='text/css'> và </style> là đoạn css định hình dạng cho nút Back to Top, các bạn tùy chỉnh thoải mái. Dòng code màu lam là thư viện Jquery, nếu có rồi thì các bạn nên xóa nó đi. BACK TO TOP các bạn thay bằng gì cũng được (GO TOP chẳng hạn).
Bạn có thể download file min.js [tại đây - click bỏ qua quảng cáo để download] sau đó bạn có thể upload lên google code để lưu trữ lâu dài.
<SCRIPT language=JavaScript1.1>3. Làm Thanh Tiêu Đề Web Chạy Trên Task Manager Khi Đóng Mở Web
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>
<script language=javascript >4. Chống Click Chuột Phải ... Và Làm "Giật Giật Web Nêu Người Xem Cứ Cố ý Click Right ...
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=" wWw.KyNiemB2.Top1.Vn "}
}
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>
<SCRIPT language=JavaScript>5. Làm Con Chuột Có Mấy Cái Vòng Chạy Chạy Xung Quanh ...
document.onmousedown=click
var times=0
var times2=10
function click() {
if ((event.button==2) || (event.button==3)) {
if (times>=1) { earthquake() }
alert("Ban Ko Dc Click Chuot Phai");
times++ } }
function earthquake() {
alert("Ban Ko Dc Click Chuot Phai");
window.moveTo(0, 0)
window.moveTo(1, 1)
window.moveTo(2, 2)
window.moveTo(3, 3)
window.moveTo(4, 4)
window.moveTo(5, 5)
window.moveTo(6, 6)
window.moveTo(7, 7)
window.moveTo(8, 8)
window.moveTo(9, 9)
window.moveTo(10, 10)
window.moveTo(9, 9)
window.moveTo(8, 8)
window.moveTo(7, 7)
window.moveTo(6, 6)
window.moveTo(5, 5)
window.moveTo(4, 4)
window.moveTo(3, 3)
window.moveTo(2, 2)
window.moveTo(1, 1)
alert("Giat Nhu Fiml Nha??!")
tremmors()
}
function tremmors() {
window.moveTo(0, 0)
window.moveTo(1, 1)
window.moveTo(2, 2)
window.moveTo(3, 3)
window.moveTo(4, 4)
window.moveTo(5, 5)
window.moveTo(6, 6)
window.moveTo(7, 7)
window.moveTo(8, 8)
window.moveTo(9, 9)
window.moveTo(10, 10)
window.moveTo(11, 11)
window.moveTo(12, 12)
window.moveTo(9, 9)
window.moveTo(8, 8)
window.moveTo(7, 7)
window.moveTo(6, 6)
window.moveTo(5, 5)
window.moveTo(4, 4)
window.moveTo(3, 3)
window.moveTo(2, 2)
window.moveTo(1, 1)
tremmors()
}
</SCRIPT>
<script language="JavaScript">6. TITLE Chạy .....
<!-- Mouse Attack by Kurt Grigg - http://www.btinternet.com/~kurt.grigg/javascript
var num=10;//Number of dots!
var vel=20;//Speed!
var col=new Array('#0080ff','#ffffff','#0000ff','#44ccff');//Dot colours, min 2!
var stopafter=60; //Stop and clear after x secondS!
//Nothing needs altering past here....................
var MAy=0;
var MAx=0;
var py=0;
var px=0;
var angle=0;
var distance=0;
var rep;
var ry=0;
var rx=0;
var tmr=null;
var n4=(document.layers);
var n6=(document.getElementById&&!document.all);
var ie=(document.all);
var o6=(navigator.appName.indexOf("Opera") != -1)?true:false;
var _d=(n4||ie)?'document.':'document.getElementById(" ';
var _a=(n4||n6)?'':'all.';
var _r=(n6)?'")':'';
var _s=(n4)?'':'.style';
var v=(n4)?"show":"visible";
var put=false;
stopafter*=1000;
if (n4||n6){
window.captureEvents(Event.MOUSEMOVE);
function mouse1(e){
if (put) return false;
MAy = e.pageY-window.pageYOffset;
MAx = e.pageX;
}
if (n4) window.onMouseMove=mouse1;
else document.onmousemove=mouse1;
}
if (ie||o6){
function mouse2(){
if (put) return false;
MAy = (ie)?event.clientY:event.clientY-window.pageYOffset;
MAx = event.clientX;
}
document.onmousemove=mouse2;
}
if (n4){
for (inc=0; inc < num; inc++)
document.write('<layer name=dots'+inc+' top=0 left=0 width='+inc/3+' height='+inc/3+' bgcolor=#ffffff></layer>');
}
else{
if (ie&&!o6){
document.write("<div id='outer' style='position:absolute;top:0px;left:0px'>");
document.write("<div style='position:relative'>");
}
for (inc=0; inc < num; inc++)
document.write('<div id="dots'+inc+'" style="position:absolute;top:0px;left:0px;width:'+ inc/3+';height:'+inc/3+';background:#ffffff;font-size:1">.</div>');
if (ie&&!o6) document.write("</div></div>");
}
function pos(){
h=(ie)?document.body.clientHeight:window.innerHeig ht-20;
w=(ie)?document.body.clientWidth:window.innerWidth-20;
ry=Math.round(Math.random()*h);
rx=Math.round(Math.random()*w);
rep=Math.round(Math.random()*3);
if (rep == 3)ry=0;
if (rep == 2)ry=h;
if (rep == 1)rx=0;
if (rep == 0)rx=w;
py=ry;
px=rx;
}
pos();
function followleader(){
sy=(!ie)?window.pageYOffset:0;
sx=(!ie)?window.pageXOffset:0;
if (ie) outer.style.top=document.body.scrollTop;
for (inc=0; inc < num; inc++){
randomcol=col[Math.floor(Math.random()*col.length)];
temp1=eval(_d+_a+"dots"+inc+_r+_s);
temp1.visibility=v;
if (inc < num-1){
temp2=eval(_d+_a+"dots"+(inc+1)+_r+_s);
temp1.top=temp2.top;
temp1.left=temp2.left
}
else{
temp1.top=py+sy;
temp1.left=px;
}
if (n4)temp1.bgColor=randomcol;
else temp1.background=randomcol;
}
}
function bomb(){
ay=MAy-py;
ax=MAx-px;
angle=Math.round(Math.atan2(ay,ax)*180/Math.PI);
if (angle < 0) angle += 360;
MAdy=py-MAy;
MAdx=px-MAx;
distance=Math.floor(Math.sqrt(MAdx*MAdx+MAdy*MAdy) );
go_y = Math.round(vel*Math.sin(angle*Math.PI/180));
go_x = Math.round(vel*Math.cos(angle*Math.PI/180));
py+=go_y;
px+=go_x;
if (distance < vel) pos();
followleader();
tmr=setTimeout("bomb()",20);
}
bomb();
function dsbl(){
v=(n4)?"hide":"hidden";
put=true;
MAx=0;
MAy=0;
setTimeout('clearTimeout(tmr)',stopafter+100);
}
setTimeout('dsbl()',stopafter);
//-->
</script>
<script language=JavaScript>7. Dòng Chữ Chạy Dưới web ...
var txt=" ..:: WelCome To Website | wWw.KyNiemB2.Top1.Vn | Mang Giai Tri Online -> 12B2 THPT EaH'Leo - Daklak - Design : HoangVu Entertainment© -";
var expert=200;
// speed of roll
var refresh=null;
function marquee_title(){
document.title=txt;
txt=txt.substring(1,txt.lenghth)+txt.charAt(0);
refresh=setTimeout("marquee_title()",expert);
}
marquee_title();
</script>
<SCRIPT language=JavaScript>8. Tạo 1 Button Giờ Trên Website
puchtit=")«-»(..:: Welcome To WwW.NhoOi.Kiss.To ::..)«-»(";
letrero2="·.¸¸.·´´¯`··._.·";
letrero1="·.¸¸.·´´¯`··._.·";ultimo1=letr ero1.length-1;
ultimo2=letrero2.length-1;
tiempo=setTimeout("scroll()",.100);
function scroll()
{
aux1=letrero1.charAt(ultimo1-1);
letrero1=aux1+letrero1.substring(0,ultimo1-1);
aux2=letrero2.charAt(0);
letrero2=letrero2.substring(1,ultimo2+1)+aux2;
window.status="(" + letrero1 + ")(" + letrero2 + puchtit + letrero1 + ")(" + letrero2 + ")";
tiempo=setTimeout("scroll()",.100);
return true;
}
// -->
</script>
<SCRIPT language=JavaScript>9. Bộ Đếm 10 , 9 ....0
<!-- Begin
day = new Date();
miVisit = day.getTime();
function clock() {
dayTwo = new Date();
hrNow = dayTwo.getHours();
mnNow = dayTwo.getMinutes();
scNow = dayTwo.getSeconds();
miNow = dayTwo.getTime();
if (hrNow == 0) {
hour = 12;
ap = " AM";
} else if(hrNow <= 11) {
ap = " AM";
hour = hrNow;
} else if(hrNow == 12) {
ap = " PM";
hour = 12;
} else if (hrNow >= 13) {
hour = (hrNow - 12);
ap = " PM";
}
if (hrNow >= 13) {
hour = hrNow - 12;
}
if (mnNow <= 9) {
min = "0" + mnNow;
}
else (min = mnNow)
if (scNow <= 9) {
secs = "0" + scNow;
} else {
secs = scNow;
}
time = hour + ":" + min + ":" + secs + ap;
document.form.button.value = time;
self.status = time;
setTimeout('clock()', 1000);
}
function timeInfo() {
milliSince = miNow;
milliNow = miNow - miVisit;
secsVisit = Math.round(milliNow / 1000);
minsVisit = Math.round((milliNow / 1000) / 60);
alert("There have been " + milliSince + " milliseconds since midnight, January 1, 1970. "
+ "You have spent " + milliNow + " of those milliseconds on this page. "
+ ".... About " + minsVisit + " minutes, and "
+ secsVisit + " seconds.");
}
document.write("<center><form name=\"form\">"
+ "<input type=button value=\"Click for info!\""
+ " name=button onClick=\"timeInfo()\"></form></center>");
onError = null;
clock();
// End -->
</SCRIPT>
<!---------------------------------------- NOJ DUNG --------------------->
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<!------------------------------- Thanh Trượt ---->
<STYLE>BODY A:link {
COLOR: #253d59; TEXT-DECORATION: none
}
A:visited {
COLOR: #253d59; TEXT-DECORATION: none
}
A:hover {
padding:0px; BACKGROUND: #ffffff; MARGIN: 0px; COLOR: #253d59; tahoma:
}
A:active {
padding:0px; BACKGROUND: #ffffff; MARGIN: 0px; COLOR: #253d59; tahoma:
}
HTML {
SCROLLBAR-FACE-COLOR: #ffffff; SCROLLBAR-HIGHLIGHT-COLOR: #ffffff; SCROLLBAR-SHADOW-COLOR: #ffffff; SCROLLBAR-3DLIGHT-COLOR: #ffffff; SCROLLBAR-ARROW-COLOR: #8b8b8b; SCROLLBAR-TRACK-COLOR: #ffffff; SCROLLBAR-DARKSHADOW-COLOR: #7a7a7a
}
BODY {
SCROLLBAR-FACE-COLOR: #ffffff; SCROLLBAR-HIGHLIGHT-COLOR: #ffffff; SCROLLBAR-SHADOW-COLOR: #ffffff; SCROLLBAR-3DLIGHT-COLOR: #ffffff; SCROLLBAR-ARROW-COLOR: #8b8b8b; SCROLLBAR-TRACK-COLOR: #ffffff; SCROLLBAR-DARKSHADOW-COLOR: #7a7a7a
}
</STYLE>
<!------------------------- Kieu Chu ----------------->
<META content="Microsoft FrontPage 5.0" name=GENERATOR></HEAD>
<BODY>
<CENTER><B><FONT style="FONT-SIZE: 40pt" face="Comic Sans MS"
color=#ffff00>[</FONT><FONT style="FONT-SIZE: 40pt" face="Comic Sans MS"
color=#ff3333> <A href="http://www.kyniemb2.top1.vn/">w</A></FONT><A
href="http://www.kyniemb2.top1.vn/"><FONT style="FONT-SIZE: 40pt"
face="Comic Sans MS" color=#cc00ff>W</FONT><FONT style="FONT-SIZE: 40pt"
face="Comic Sans MS" color=#ff3333>w.</FONT><FONT style="FONT-SIZE: 40pt"
face="Comic Sans MS">K<FONT color=#00ff00>y</FONT><FONT
color=#ff0000>Ni</FONT>e<FONT color=#ffff00>m</FONT><FONT
color=#cc00ff>B2</FONT>.T<FONT color=#00ff00>o</FONT>p<FONT
color=#ff3399>1</FONT>.V<FONT color=#ff0000>n</FONT></FONT></A><FONT
style="FONT-SIZE: 40pt" face="Comic Sans MS" color=#ff3333> </FONT><FONT
style="FONT-SIZE: 40pt" face="Comic Sans MS" color=#ffff00>]<BR></FONT><FONT
face="Comic Sans MS" color=#ff3399 size=6>Thay Đôi? Tên Miê`n Chính Thú*c
</FONT></B>
<DIV id=txt align=center></DIV><!--------------------- Doạn CODE ---------------->
<SCRIPT type=text/javascript>
var c=10;
var t;
var theDate = new Date();
s=theDate.getSeconds();
function ChangeUrl(site){
document.getElementById("txt").innerHTML='<br><br> <br><h3><a href="http://www.NHOOI.KISS.TO" target=Index><font face="Comic Sans MS" color=3366CC></a><br><a href="'+site+'" target=Index><font color=FF00FF><big>Click vào đây đê? vào Trang Chu? </big></font></font></a></h3><br><br><br><p align="center"><FONT face="Tahoma">Trình duyệt sẽ tự động chuyển sang <b><font color=blue>'+site+'</font></b> trong vòng <b><font color=red>'+c+'</font></b> giây nữa.<br></Font>';
document.getElementById("txt").innerHTML+='<strong ><a href="'+site+'" target="_top" onClick="this.style.behavior=\'url(#default#homepa ge)\';this.setHomePage(\'http://nhooi.kiss.to\');"><Font Face="Tahoma">Click vào đây nếu bạn chờ quá lâu [ Click ] Vao Day Cung Duoc !^^.</a></strong><br></span></p></Font>';
c-=1;
url=site;
t=setTimeout("ChangeUrl(url)",1000);
stopCount(c,url);
}
function stopCount(c,link){
if(c==-1)
{clearTimeout(t);
location.href=link;}
}
</SCRIPT>
<SCRIPT>
ChangeUrl('Http://KyNiemB2.Top1.Vn');
</SCRIPT>
<!---------------- Chu 2 -------------------->
<FONT face="Comic Sans MS" size=6><B><FONT
color=#ff0000>Design</FONT></B><B><FONT color=#00ff00> </FONT><FONT
color=#cc00ff>:</FONT><FONT color=#00ff00> </FONT><FONT
color=#ffff00>Hô`</FONT><FONT color=#00ff00> Ho</FONT>àng<FONT color=#00ff00>
</FONT><FONT color=#0000ff>Vũ</FONT><FONT color=#00ff00> </FONT><FONT
color=#cc00ff>®</FONT><FONT color=#00ff00><BR></FONT></B><FONT
color=#ffff00>Website</FONT><FONT color=#00ff00>
:wWw.KyNiemB2.Top1.Vn</FONT></FONT><FONT color=#00ff00
size=6><BR></FONT></CENTER>
</TEXTAREA></P></BODY></HTML>
[Tải Code Chương trình tại đây (Lưu ý: Sau 5s, click Bỏ qua quảng cáo - Skin Ad)]