Chia Sẽ 3 Đoạn Code Có Ích Cho Các Wapbuilder,

     Nếu bạn mới lập blog chuyên về wap thì chắc bạn đang còn lở ngỡ vài code để chèn vào các chuyên mục. Thì hôm nay mình sẽ share cho các bạn một vài đoạn code tiện ích hay mà mình chuyển từ các wapbuilder khác về blogger. Nếu thích bạn hãy đem về blog của bạn để trang trí nhé.

1: Khung Thầy Phán Cực Bựa.

<form name="form1"> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td> <font size="0" face="verdana, arial, helvetica, sans-serif"><b>Tháng</b></font> </td> <td> <font size="0" face="verdana, arial, helvetica, sans-serif"><b>Ngày</b></font> </td> <td rowspan="2"> <font size="1" face="verdana, arial, helvetica, sans-serif"></font> </td> <td> <font size="1" face="verdana, arial, helvetica, sans-serif"><b>Cung</b></font> </td> </tr> <tr> <td> <select name="month"> <option value="x" selected />Chọn <option value="1" />Tháng 1 <option value="2" />Tháng 2 <option value="3" />Tháng 3 <option value="4" />Tháng 4 <option value="5" />Tháng 5 <option value="6" />Tháng 6 <option value="7" />Tháng 7 <option value="8" />Tháng 8 <option value="9" />Tháng 9 <option value="10" />Tháng 10 <option value="11" />Tháng 11 <option value="12" />Tháng 12 </select> </td> <td> <select name="date" onchange="validate()"> <option value="y" selected />Chọn <option value="1" />Ngày 1 <option value="2" />Ngày 2 <option value="3" />Ngày 3 <option value="4" />Ngày 4 <option value="5" />Ngày 5 <option value="6" />Ngày 6 <option value="7" />Ngày 7 <option value="8" />Ngày 8 <option value="9" />Ngày 9 <option value="10" />Ngày 10 <option value="11" />Ngày 11 <option value="12" />Ngày 12 <option value="13" />Ngày 13 <option value="14" />Ngày 14 <option value="15" />Ngày 15 <option value="16" />Ngày 16 <option value="17" />Ngày 17 <option value="18" />Ngày 18 <option value="19" />Ngày 19 <option value="20" />Ngày 20 <option value="21" />Ngày 21 <option value="22" />Ngày 22 <option value="23" />Ngày 23 <option value="24" />Ngày 24 <option value="25" />Ngày 25 <option value="26" />Ngày 26 <option value="27" />Ngày 27 <option value="28" />Ngày 28 <option value="29" />Ngày 29 <option value="30" />Ngày 30 <option value="31" />Ngày 31 </select> </td> <td> <input name="sign" size="3" value="???" /> <input type="button" value="Kết Quả" onclick="sunsign()" /> </td> </tr> </table> </form><!-- End Code PhuThoBay.Pro --> <script> function sunsign() { document.form1.date.selectedIndex; document.form1.month.selectedIndex; document.form1.sign.value; if (document.form1.month.selectedIndex == 1 && document.form1.date.selectedIndex <=19) {document.form1.sign.value = "Ma kết";} if (document.form1.month.selectedIndex == 1 && document.form1.date.selectedIndex >=20) {document.form1.sign.value = "Bảo bình";} if (document.form1.month.selectedIndex == 2 && document.form1.date.selectedIndex <=18) {document.form1.sign.value = "Bảo bình";} if (document.form1.month.selectedIndex == 2 && document.form1.date.selectedIndex >=19) {document.form1.sign.value = "Song ngưu";} if (document.form1.month.selectedIndex == 3 && document.form1.date.selectedIndex <=20) {document.form1.sign.value = "Song ngưu";} if (document.form1.month.selectedIndex == 3 && document.form1.date.selectedIndex >=21) {document.form1.sign.value = "Bạch dương";} if (document.form1.month.selectedIndex == 4 && document.form1.date.selectedIndex <=20) {document.form1.sign.value = "Bạch dương";} if (document.form1.month.selectedIndex == 4 && document.form1.date.selectedIndex >=21) {document.form1.sign.value = "Kim ngư";} if (document.form1.month.selectedIndex == 5 && document.form1.date.selectedIndex <=20) {document.form1.sign.value = "Kim ngư";} if (document.form1.month.selectedIndex == 5 && document.form1.date.selectedIndex >=21) {document.form1.sign.value = "Song tử­";} if (document.form1.month.selectedIndex == 6 && document.form1.date.selectedIndex <=20) {document.form1.sign.value = "Song tử­";} if (document.form1.month.selectedIndex == 6 && document.form1.date.selectedIndex >=21) {document.form1.sign.value = "Cự giải";} if (document.form1.month.selectedIndex == 7 && document.form1.date.selectedIndex <=21) {document.form1.sign.value = "Cự giải";} if (document.form1.month.selectedIndex == 7 && document.form1.date.selectedIndex >=22) {document.form1.sign.value = "Sư tử­";} if (document.form1.month.selectedIndex == 8 && document.form1.date.selectedIndex <=21) {document.form1.sign.value = "Sư tử­";} if (document.form1.month.selectedIndex == 8 && document.form1.date.selectedIndex >=22) {document.form1.sign.value = "Xử nữ";} if (document.form1.month.selectedIndex == 9 && document.form1.date.selectedIndex <=21) {document.form1.sign.value = "Xử nữ";} if (document.form1.month.selectedIndex == 9 && document.form1.date.selectedIndex >=22) {document.form1.sign.value = "Thiên bình";} if (document.form1.month.selectedIndex == 10 && document.form1.date.selectedIndex <=21) {document.form1.sign.value = "Thiên bình";} if (document.form1.month.selectedIndex == 10 && document.form1.date.selectedIndex >=22) {document.form1.sign.value = "Bò cạp";} if (document.form1.month.selectedIndex == 11 && document.form1.date.selectedIndex <=21) {document.form1.sign.value = "Bò cạp";} if (document.form1.month.selectedIndex == 11 && document.form1.date.selectedIndex >=22) {document.form1.sign.value = "Nhân Mã";} if (document.form1.month.selectedIndex == 12 && document.form1.date.selectedIndex <=20) {document.form1.sign.value = "Nhân mã";} if (document.form1.month.selectedIndex == 12 && document.form1.date.selectedIndex >=21) {document.form1.sign.value = "Ma kết";} if (document.form1.month.selectedIndex == "x" || document.form1.date.selectedIndex == "y") return; } function validate() { if (document.form1.month.selectedIndex == 2 && document.form1.date.selectedIndex > 29) {alert("ChĂ¡Â»â€° cĂ³ tĂ¡Â»â€˜i Ă„â€˜a lÄ‚ 29 ngÄ‚ y vÄ‚ o thĂ¡ng Hai."); return false;} if (document.form1.month.selectedIndex == 4 && document.form1.date.selectedIndex == 31) {alert("ChĂ¡Â»â€° cĂ³ 30 ngÄ‚ y trong thĂ¡ng Tư."); return false;} if (document.form1.month.selectedIndex == 6 && document.form1.date.selectedIndex == 31) {alert("ChĂ¡Â»â€° cĂ³ 30 ngÄ‚ y trong thĂ¡ng SĂ¡u."); return false;} if (document.form1.month.selectedIndex == 9 && document.form1.date.selectedIndex == 31) {alert("ChĂ¡Â»â€° cĂ³ 30 ngÄ‚ y trong thĂ¡ng ChĂ­n."); return false;} if (document.form1.month.selectedIndex == 11 && document.form1.date.selectedIndex == 31) {alert("ChĂ¡Â»â€° cĂ³ 30 ngÄ‚ y trong thĂ¡ng mĂ†Â°Ă¡Â»Âi mĂ¡Â»â„¢t."); return false;} else{ return true; } } </script>
Demo

2: Máy Đo Tình Yêu Cực Chất.

<script> document.write ('<center><form name="loveform">Nhập Tên Bạn:<font color="#33ff00">:</font><br><input name="name1" type="text" size="15" value="Bill Gates"onfocus="if(this.value="Bill Gates"/><br>Nhập Tên Người Ấy:</b><br><input name="name2" type="text" size="15" value="Lê thị huyền anh"onfocus="if(this.value="Lê thị huyền anh"/><br>Cơ hội yêu nhau:<font color="#33ff00">:</font><br><input value name="output" type="text" size="6"> <input value="Xem Kết Quả" name="calculate" type="button" value="calculate" onclick="calc()"></form></center>'); function calc() { first = document.loveform.name1.value.toUpperCase(); firstlength = document.loveform.name1.value.length; second = document.loveform.name2.value.toUpperCase(); secondlength = document.loveform.name2.value.length; var LoveCount=0; for (Count=0; Count < firstlength; Count++) { letter1=first.substring(Count,Count+1); if (letter1=='L') LoveCount+=2; if (letter1=='O') LoveCount+=2; if (letter1=='V') LoveCount+=2; if (letter1=='E') LoveCount+=2; if (letter1=='Y') LoveCount+=3; if (letter1=='O') LoveCount+=1; if (letter1=='U') LoveCount+=3; } for (Count=0; Count < secondlength; Count++) { letter2=second.substring(Count,Count+1); if (letter2=='L') LoveCount+=2; if (letter2=='O') LoveCount+=2; if (letter2=='V') LoveCount+=2; if (letter2=='E') LoveCount+=2; if (letter2=='Y') LoveCount+=3; if (letter2=='O') LoveCount+=1; if (letter2=='U') LoveCount+=3; } amount=0; if (LoveCount> 0) amount= 5-((firstlength+secondlength)/2) if (LoveCount> 2) amount= 10-((firstlength+secondlength)/2) if (LoveCount> 4) amount= 20-((firstlength+secondlength)/2) if (LoveCount> 6) amount= 30-((firstlength+secondlength)/2) if (LoveCount> 8) amount= 40-((firstlength+secondlength)/2) if (LoveCount>10) amount= 50-((firstlength+secondlength)/2) if (LoveCount>12) amount= 60-((firstlength+secondlength)/2) if (LoveCount>14) amount= 70-((firstlength+secondlength)/2) if (LoveCount>16) amount= 80-((firstlength+secondlength)/2) if (LoveCount>18) amount= 90-((firstlength+secondlength)/2) if (LoveCount>20) amount=100-((firstlength+secondlength)/2) if (LoveCount>22) amount=110-((firstlength+secondlength)/2) if (firstlength==0 || secondlength==0) amount= "Err"; if (amount < 0) amount= 0; if (amount >99) amount=99; document.loveform.output.value=amount+"%"; } </script>
Demo

3: Tool Nhận Biết Chòm Sao.

<form name="form1"> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td> <font size="0" face="verdana, arial, helvetica, sans-serif"><b>Tháng</b></font> </td> <td> <font size="0" face="verdana, arial, helvetica, sans-serif"><b>Ngày</b></font> </td> <td rowspan="2"> <font size="1" face="verdana, arial, helvetica, sans-serif"></font> </td> <td> <font size="1" face="verdana, arial, helvetica, sans-serif"><b>Cung</b></font> </td> </tr> <tr> <td> <select name="month"> <option value="x" selected />Chọn <option value="1" />Tháng 1 <option value="2" />Tháng 2 <option value="3" />Tháng 3 <option value="4" />Tháng 4 <option value="5" />Tháng 5 <option value="6" />Tháng 6 <option value="7" />Tháng 7 <option value="8" />Tháng 8 <option value="9" />Tháng 9 <option value="10" />Tháng 10 <option value="11" />Tháng 11 <option value="12" />Tháng 12 </select> </td> <td> <select name="date" onchange="validate()"> <option value="y" selected />Chọn <option value="1" />Ngày 1 <option value="2" />Ngày 2 <option value="3" />Ngày 3 <option value="4" />Ngày 4 <option value="5" />Ngày 5 <option value="6" />Ngày 6 <option value="7" />Ngày 7 <option value="8" />Ngày 8 <option value="9" />Ngày 9 <option value="10" />Ngày 10 <option value="11" />Ngày 11 <option value="12" />Ngày 12 <option value="13" />Ngày 13 <option value="14" />Ngày 14 <option value="15" />Ngày 15 <option value="16" />Ngày 16 <option value="17" />Ngày 17 <option value="18" />Ngày 18 <option value="19" />Ngày 19 <option value="20" />Ngày 20 <option value="21" />Ngày 21 <option value="22" />Ngày 22 <option value="23" />Ngày 23 <option value="24" />Ngày 24 <option value="25" />Ngày 25 <option value="26" />Ngày 26 <option value="27" />Ngày 27 <option value="28" />Ngày 28 <option value="29" />Ngày 29 <option value="30" />Ngày 30 <option value="31" />Ngày 31 </select> </td> <td> <input name="sign" size="3" value="???" /> <input type="button" value="Kết Quả" onclick="sunsign()" /> </td> </tr> </table> </form><!-- End Code PhuThoBay.Pro --> <script> function sunsign() { document.form1.date.selectedIndex; document.form1.month.selectedIndex; document.form1.sign.value; if (document.form1.month.selectedIndex == 1 && document.form1.date.selectedIndex <=19) {document.form1.sign.value = "Ma kết";} if (document.form1.month.selectedIndex == 1 && document.form1.date.selectedIndex >=20) {document.form1.sign.value = "Bảo bình";} if (document.form1.month.selectedIndex == 2 && document.form1.date.selectedIndex <=18) {document.form1.sign.value = "Bảo bình";} if (document.form1.month.selectedIndex == 2 && document.form1.date.selectedIndex >=19) {document.form1.sign.value = "Song ngưu";} if (document.form1.month.selectedIndex == 3 && document.form1.date.selectedIndex <=20) {document.form1.sign.value = "Song ngưu";} if (document.form1.month.selectedIndex == 3 && document.form1.date.selectedIndex >=21) {document.form1.sign.value = "Bạch dương";} if (document.form1.month.selectedIndex == 4 && document.form1.date.selectedIndex <=20) {document.form1.sign.value = "Bạch dương";} if (document.form1.month.selectedIndex == 4 && document.form1.date.selectedIndex >=21) {document.form1.sign.value = "Kim ngư";} if (document.form1.month.selectedIndex == 5 && document.form1.date.selectedIndex <=20) {document.form1.sign.value = "Kim ngư";} if (document.form1.month.selectedIndex == 5 && document.form1.date.selectedIndex >=21) {document.form1.sign.value = "Song tử­";} if (document.form1.month.selectedIndex == 6 && document.form1.date.selectedIndex <=20) {document.form1.sign.value = "Song tử­";} if (document.form1.month.selectedIndex == 6 && document.form1.date.selectedIndex >=21) {document.form1.sign.value = "Cự giải";} if (document.form1.month.selectedIndex == 7 && document.form1.date.selectedIndex <=21) {document.form1.sign.value = "Cự giải";} if (document.form1.month.selectedIndex == 7 && document.form1.date.selectedIndex >=22) {document.form1.sign.value = "Sư tử­";} if (document.form1.month.selectedIndex == 8 && document.form1.date.selectedIndex <=21) {document.form1.sign.value = "Sư tử­";} if (document.form1.month.selectedIndex == 8 && document.form1.date.selectedIndex >=22) {document.form1.sign.value = "Xử nữ";} if (document.form1.month.selectedIndex == 9 && document.form1.date.selectedIndex <=21) {document.form1.sign.value = "Xử nữ";} if (document.form1.month.selectedIndex == 9 && document.form1.date.selectedIndex >=22) {document.form1.sign.value = "Thiên bình";} if (document.form1.month.selectedIndex == 10 && document.form1.date.selectedIndex <=21) {document.form1.sign.value = "Thiên bình";} if (document.form1.month.selectedIndex == 10 && document.form1.date.selectedIndex >=22) {document.form1.sign.value = "Bò cạp";} if (document.form1.month.selectedIndex == 11 && document.form1.date.selectedIndex <=21) {document.form1.sign.value = "Bò cạp";} if (document.form1.month.selectedIndex == 11 && document.form1.date.selectedIndex >=22) {document.form1.sign.value = "Nhân Mã";} if (document.form1.month.selectedIndex == 12 && document.form1.date.selectedIndex <=20) {document.form1.sign.value = "Nhân mã";} if (document.form1.month.selectedIndex == 12 && document.form1.date.selectedIndex >=21) {document.form1.sign.value = "Ma kết";} if (document.form1.month.selectedIndex == "x" || document.form1.date.selectedIndex == "y") return; } function validate() { if (document.form1.month.selectedIndex == 2 && document.form1.date.selectedIndex > 29) {alert("ChĂ¡Â»â€° cĂ³ tĂ¡Â»â€˜i Ă„â€˜a lÄ‚ 29 ngÄ‚ y vÄ‚ o thĂ¡ng Hai."); return false;} if (document.form1.month.selectedIndex == 4 && document.form1.date.selectedIndex == 31) {alert("ChĂ¡Â»â€° cĂ³ 30 ngÄ‚ y trong thĂ¡ng Tư."); return false;} if (document.form1.month.selectedIndex == 6 && document.form1.date.selectedIndex == 31) {alert("ChĂ¡Â»â€° cĂ³ 30 ngÄ‚ y trong thĂ¡ng SĂ¡u."); return false;} if (document.form1.month.selectedIndex == 9 && document.form1.date.selectedIndex == 31) {alert("ChĂ¡Â»â€° cĂ³ 30 ngÄ‚ y trong thĂ¡ng ChĂ­n."); return false;} if (document.form1.month.selectedIndex == 11 && document.form1.date.selectedIndex == 31) {alert("ChĂ¡Â»â€° cĂ³ 30 ngÄ‚ y trong thĂ¡ng mĂ†Â°Ă¡Â»Âi mĂ¡Â»â„¢t."); return false;} else{ return true; } } </script>
Demo
Lưu ý: Cái code trên mình chưa viết css, các bạn tự thêm css vào nhé.

Nhận xét

Bài đăng phổ biến từ blog này

Những Điều Cần Làm Trước Và Sau Khi Xuất Bản Bài Viết Blogspot.

Tham gia Blog - Tôi mở ra một con đường mới

PSD Ảnh Bìa - Cô Đơn.