แสดงกระทู้
|
หน้า: [1] 2
|
1
|
พัฒนาเว็บไซต์ / Programming / กด refresh หน้าเว็บ เเล้วให้ขึ้นโหลดหน้าเว็บ ที่ขึ้นแถบโหลดครับ
|
เมื่อ: 15 มีนาคม 2020, 15:24:10
|
ตอนเข้าหน้าเว็บเเล้วมีเเถบรอโหลด ผมทำได้เเล้ว ทีนี้ผมอยากให้กดปุ่ดเเล้วขึ้นเเถบรอโหลด ตอนเราอยู่หน้า home ยังไม่เเสดงข้อมูล ถ้าเรากดปุ่ม Success ผมอยากให้ขึ้นเเถบรอโหลด เเล้วมันจะเเสดงข้อมูล ต้องทำยังำไงครับ มีโค้ดเเล้ว เเต่ติดที่จะเอามาใช้ยังไงครับ <!DOCTYPE html> <html lang="en"> <head> <title>Bootstrap Example</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script> <style type="text/css"> #overlay { position: absolute; top: 0px; left: 0px; background: #ccc; width: 100%; height: 100%; opacity: .75; filter: alpha(opacity=75); -moz-opacity: .75; z-index: 999; background: #fff url(http://i.imgur.com/KUJoe.gif) 50% 50% no-repeat; } .main-contain{ position: absolute; top: 0px; left: 0px; width: 100%; height: 100%; overflow: hidden; } </style> </head> <body> <button type="button" class="btn btn-success">Success</button> <div class="container"> <h2>Dynamic Tabs</h2> <ul class="nav nav-tabs"> <li class="active"><a href="#home">Home</a></li> <li><a href="#menu1">Menu 1</a></li> <li><a href="#menu2">Menu 2</a></li> <li><a href="#menu3">Menu 3</a></li> </ul> <div id="overlay"></div> <div class="main-contain"> <div class="tab-content"> <div id="home" class="tab-pane fade in active "> <h3>HOME</h3> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> </div> <div id="menu1" class="tab-pane fade active in "> <h3>Menu 1</h3> <p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p> </div> <div id="menu2" class="tab-pane fade active in"> <h3>Menu 2</h3> <p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam.</p> </div> <div id="menu3" class="tab-pane fade active in"> <h3>Menu 3</h3> <p>Eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.</p> </div> </div> </div> </div> <script> $(document).ready(function(){ $(".nav-tabs a").click(function(){ $(this).tab('show'); }); });
$("#home.tab-pane").removeClass("active in"); // เริ่มต้นไม่แสดง $("#menu1.tab-pane").removeClass("active in"); // เริ่มต้นไม่แสดง $("#menu2.tab-pane").removeClass("active in"); $("#menu3.tab-pane").removeClass("active in"); var tabHome = null; // สร้างตัวแปร เก็บสถานะการคลิกที่ปุ่ม var tabmenu1 = null;
$(".btn-success").click(function(){ tabHome = true; // เปลี่ยนสถานะเมื่อคลิก tabmenu1 = true;
});
$('.nav-tabs a').on('shown.bs.tab', function (e) { // เมื่อแสดงข้อมูลในแท็บแล้ว
if($(e.target).attr("href")=="#home"){ // ถ้าเป็นของปุ่ม แรก //console.log("Home click");
if(tabHome == true){ // เมื่อมีกาารคลิกที่ปุ่ม success }else{ // ยังไม่คลิก $("#home.tab-pane").removeClass("active in"); // ยังไม่แสดง } }
if($(e.target).attr("href")=="#menu1"){ // ถ้าเป็นของปุ่ม แรก //console.log("menu1 click");
if(tabmenu1 == true){ // เมื่อมีกาารคลิกที่ปุ่ม success }else{ // ยังไม่คลิก $("#menu1.tab-pane").removeClass("active in"); // ยังไม่แสดง } }
});
$(".btn-success").click(function(){ tabHome = true; // เปลี่ยนสถานะเมื่อคลิก tabmenu1 = true;
if($("a[href='#home']").parent("li").hasClass("active")){ // ก้าถูกซ่อนอยู่
$("#home.tab-pane").addClass("active in"); // ให้แสดงข้อมูล console.log("home click"); tabmenu1 = null;
$( "#home" ).load(window.location.href " #home" ); }
if($("a[href='#menu1']").parent("li").hasClass("active")){ // ก้าถูกซ่อนอยู่ $("#menu1.tab-pane").addClass("active in"); // ให้แสดงข้อมูล tabHome = null;
$( "#menu1" ).load(window.location.href " #menu1" ); } });
$(function(){ $("#overlay").fadeOut(); $(".main-contain").removeClass("main-contain"); }); </script>
</body> </html>
|
|
|
2
|
พัฒนาเว็บไซต์ / Programming / จะเอาเลขที่เเสดงตรงนี้ออกยังไงครับ
|
เมื่อ: 24 ตุลาคม 2019, 18:30:44
|
พอกดเลขหรือรูปด้านล่างให้มันเเสดงรูปที่ช่องบน เเต่จะเอาเลขที่วงกลมออกยังไงครับ อีกอย่างครับ จะลดขนาดที่เเสดงให้เล็กกว่านี้ได้ไหม <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <!-- <link rel="stylesheet" type="text/css" href="style.css"> --> <style> *{ margin: 0; padding: 0; } table, th { border: 1px solid black; border-collapse: collapse; text-align: center; width: 100%; } td { border: 1px solid black; border-collapse: collapse; width: 40px; height: 20px; } .set1 { border: none; outline: none; background-color: #f1f1f1; cursor: pointer; font-size: 25px; } .active, .set1:hover { background-color: #666; color: white; } div.f1{ width: 1000px; } </style> </head> <body> <script> myFunction = i => $(".demo1 td:empty:first").html($(i).html()); </script> <div > <table class="demo1" style="background-color:#E6E6E6"> <tbody> <tr> <td> <table style="border: 0px;"> <tbody> <tr> <td colspan="2" style="border: 0px;" id="resultsicbo-1-0-0"></td>
</tr> <tr> <td style="border: 0px;" ></td> <td style="border: 0px;" ></td> </tr> </tbody> </table> </td>
<td> <table style="border: 0px;"> <tbody> <tr> <td colspan="2" style="border: 0px;" id="resultsicbo-1-0-0"></td>
</tr> <tr> <td style="border: 0px;" ></td> <td style="border: 0px;" ></td> </tr> </tbody> </table> </td>
<td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr> </tbody> </table> <br><br><br>
</div> <div class="f1"> <table> <tbody> <tr> <td id="test1"> <table style="border: 0px;" > <tbody> <tr onclick="myFunction(this)" > <td width="50%" class="set1" style="border: 0px;">1</td> <td width="50%" class="set1" style="border: 0px;"><img width="50" height="50" src="img/number1.png"></td> </tr> </tbody> </table> </td> <td id="test2"> <table style="border: 0px;" > <tbody> <tr onclick="myFunction(this)" > <td width="50%" class="set1" style="border: 0px;">2</td> <td width="50%" class="set1" style="border: 0px;"><img width="50" height="50" src="img/number2.png"></td> </tr> </tbody> </table> </td> <td id="test1"> <table style="border: 0px;" > <tbody> <tr onclick="myFunction(this)" > <td width="50%" class="set1" style="border: 0px;">3</td> <td width="50%" class="set1" style="border: 0px;"><img width="50" height="50" src="img/number3.png"></td> </tr> </tbody> </table> </td> <td id="test1"> <table style="border: 0px;" > <tbody> <tr onclick="myFunction(this)" > <td width="50%" class="set1" style="border: 0px;">4</td> <td width="50%" class="set1" style="border: 0px;"><img width="50" height="50" src="img/number4.png"></td> </tr> </tbody> </table> </td> <td id="test1"> <table style="border: 0px;" > <tbody> <tr onclick="myFunction(this)" > <td width="50%" class="set1" style="border: 0px;">5</td> <td width="50%" class="set1" style="border: 0px;"><img width="50" height="50" src="img/number5.png"></td> </tr> </tbody> </table> </td> <td id="test1"> <table style="border: 0px;" > <tbody> <tr onclick="myFunction(this)" > <td width="50%" class="set1" style="border: 0px;">6</td> <td width="50%" class="set1" style="border: 0px;"><img width="50" height="50" src="img/number6.png"></td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </div> </body> </html>
|
|
|
8
|
พัฒนาเว็บไซต์ / Programming / Re: ผมจะสร้างสีเหลี่ยมเป็นเเถวเเบบนี้ยังไงครับ php
|
เมื่อ: 01 ตุลาคม 2019, 13:30:02
|
ตอนนี้ผมติดอยู่2ที่ครับ พอกดเลข4ครั้งเเล้วมันขึ้นสีพื้นหลัง พอกดครั้งที่5 ถ้าเรากดเลขที่ขึ้นสีพื้นหลังให้ขึ้นรูปติ้กถูก ถ้าไม่ได้กดเลขที่มีสีพื้นหลังให้ขึ้นรูปติ้กผิด ถ้ากดตัวเลขทุก 5 ครั้ง ให้มันเเสดงที่ตารางล่างยังไงครับ ตอนนี้กดมันขึ้นเเต่ช่องเเรกครับ พอเขียนประมาณไหนครับ <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <!-- <link rel="stylesheet" type="text/css" href="style.css"> -->
<style> *{ margin: 0; padding: 0; }
.Analysis {
width:70%; height: 139px; margin:0 auto; border:1px solid #000000; margin-bottom: 100px;
}
.containertt {
width:70%; height: 50px; margin:0 auto; text-align: center;
} table, th { border: 1px solid black; border-collapse: collapse; text-align: center; } td { border: 1px solid black; border-collapse: collapse; width: 50px; height: 50px;
}
.grid-container { display: grid; grid-template-columns:auto auto auto auto auto auto auto auto auto auto auto auto auto; grid-gap: 2px; background-color: #2196F3; padding: 10px;
}
.grid-container > div { background-color: lightblue; text-align: center; padding: 10px ; font-size: 30px; }
#item1 { grid-row: 1 / 4; }
</style> </head> <body>
<table class="table" id="demo1" style="background-color:#E6E6E6"> <tr > <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> </table>
<div class="grid-container" >
<div onclick="myFunction(this)" id="item1" class="test0"><font color=red>0</font></div>
<div onclick="myFunction(this)" class="test" id="test2">2</div>
<div onclick="myFunction(this)" class="test" id="test4">4</div> <div onclick="myFunction(this)" class="test" id="test6"><font color=red>6</font></div> <div onclick="myFunction(this)" class="test"><font color=red>8</font></div> <div onclick="myFunction(this)" class="test">10</div> <div onclick="myFunction(this)" class="test"><font color=red>12</font></div> <div onclick="myFunction(this)" class="test"><font color=red>14</font></div> <div onclick="myFunction(this)" class="test">16</div> <div onclick="myFunction(this)" class="test"><font color=red>18</font></div> <div onclick="myFunction(this)" class="test"><font color=red>20</font></div> <div onclick="myFunction(this)" class="test">22</div> <div onclick="myFunction(this)" class="test">24</div> <div onclick="myFunction(this)" class="test" id="test1">1</div> <div onclick="myFunction(this)" class="test" id="test3"><font color=red>3</font></div> <div onclick="myFunction(this)" class="test" id="test5">5</div> <div onclick="myFunction(this)" class="test">7</div> <div onclick="myFunction(this)" class="test"><font color=red>9</font></div> <div onclick="myFunction(this)" class="test">11</div> <div onclick="myFunction(this)" class="test">13</div> <div onclick="myFunction(this)" class="test"><font color=red>15</font></div> <div onclick="myFunction(this)" class="test">17</div> <div onclick="myFunction(this)" class="test">19</div> <div onclick="myFunction(this)" class="test">21</div> <div onclick="myFunction(this)" class="test">23</div>
<!-- <div onClick="onClick()" class="test" id="test1" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">333</div>
<div class="test"id="test2" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">444</div> <div class="test" id="test3" mouseenter="this.style.backgroundColor='yellow';" mouseleave="this.style.backgroundColor='lightblue';" >555</div> -->
</div> <script> myFunction = i => $("#demo1 td:empty:first").html($(i).html()) var tooClick = 0; var totalClick = 0; // จำนวนคลิกทั้งหมด var evenClick = 0; // จำนวนคลิกเลขคู่ var oddClick = 0; // จำนวนคลิกเลขคี่ var result=false; var backgound=""; var clicks = 0; var po = 0; function clickCount() { clicks = 1; //ตรงนี้ใส่ clicks = 1; po = Math.floor(Math.random() * 4); }
function changBackground() { return backgound = clicks==4 ? "backgound:yellow" : ""; }
function reset() { $(".test").css("background-color", "lightblue"); $(".test1").css("background-color", "lightblue"); $(".test2").css("background-color", "lightblue"); $("#test1").css("background-color", "lightblue"); $("#test2").css("background-color", "lightblue"); evenClick=0; oddClick=0; tooClick=0; result=false; return; } function pop() { alert("Hello! I am an alert box!"); window.location.reload(); }
$(function(){ $(".test").click(function(){
clickCount();
document.getElementById("clicks").innerHTML = clicks; document.getElementById("demo").innerHTML = $(this).text(); document.getElementById("ran").innerHTML = po;
if ($(this).text()%2==0) { evenClick ; //ตรงนี้ใส่ evenClick ; oddClick ; //ตรงนี้ใส่ oddClick ; if(evenClick % 4 ==0){ if (po%2==0) { $("#test1,#test2").css("background-color", "yellow"); }else if (po%2==1) { $("#test3,#test4").css("background-color", "#80E12A"); } }else if(evenClick % 5 ==0){ document.getElementById("golf").innerHTML = $(this).text(); reset(); }
}else if ($(this).text()%2==1) { oddClick ; //ตรงนี้ใส่ oddClick ; evenClick ; //ตรงนี้ใส่ evenClick ; if(oddClick % 4 ==0){ if (po%2==0) { $("#test5,#test6").css("background-color", "#73E1E1"); }else if (po%2==1) { $("#test3,#test4").css("background-color", "#80E12A"); } }else if(oddClick % 5 ==0){ document.getElementById("golf").innerHTML = $(this).text(); reset(); } } if (clicks>60) { pop(); }
}); });
</script>
<p>Clicks: <a id="clicks">0</a></p> <p id="demo"></p> <p>ran: <a id="ran">0</a></p> </script> <table class="table" id="demo2" style="background-color:#E6E6E6" > <tr> <td>ครั้งที่5</td> <td id="golf"></td> <td id="golf2"></td> <td id="golf3"></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> </table>
<table> <tr> <td>ถูก</td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td>ผิด</td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> </table>
</body> </html> เเก้ในโค้ดมันไม่ขึ้น บวก clicks บวก= 1; evenClick บวกบวก]; oddClick บวกบวก;
|
|
|
11
|
พัฒนาเว็บไซต์ / Programming / Re: ผมจะสร้างสีเหลี่ยมเป็นเเถวเเบบนี้ยังไงครับ php
|
เมื่อ: 27 กันยายน 2019, 12:28:28
|
<!DOCTYPE html> <html lang="en">
<head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script> $(() => { // you can wrap it here with in document ready block let round = click = 0 $("p").click(() => { click $('#r').val(click) if (click % 4 === 0) { $('#r').val('ตัวเลขทุก 4 ครั้ง รอบที่ ' round ) click = 0 } }) }) </script> </head>
<body> <p>อะไรสักอย่าง กด ตรงนี้เบาๆ ตัวหนังสือนี่แหละ คลิกเลย</p> <input type="button" id="r" value="0"> </body>
</html> ลองดูนะ ถ้านับได้ จะทำอะไรก็ได้ กดเเล้วเงียบกริบเลยครับ
|
|
|
12
|
พัฒนาเว็บไซต์ / Programming / Re: ผมจะสร้างสีเหลี่ยมเป็นเเถวเเบบนี้ยังไงครับ php
|
เมื่อ: 27 กันยายน 2019, 10:02:12
|
พอจะเขียนเค้าโครงได้ไหมครับผมลองเเล้วไม่ได้ ยังติดตรงนี้อยู่เลยครับ ถ้ากดตัวเลขทุก 4 ครั้ง ให้มันโชว์พื้นหลังสีเหลืองกรอบที่1 (1,2,3,4,5,6,7,8,9,10,11,12) เหมือนเราเอาเม้าส์ชี้ที่ตัวเลขครับ เเล้วพอกดครั้งที่ 5 ให้กรอบหายเเล้วเเสดงในตารางข้างล่าง <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <!-- <link rel="stylesheet" type="text/css" href="style.css"> -->
<style> *{ margin: 0; padding: 0; } .Analysis {
width:70%; height: 139px; margin:0 auto; border:1px solid #000000; margin-bottom: 100px; }
.containertt { width:70%; height: 50px; margin:0 auto; text-align: center; } table, th { border: 1px solid black; border-collapse: collapse; text-align: center; } td { border: 1px solid black; border-collapse: collapse; width: 50px; height: 50px; font-size: 30px; }
.grid-container { display: grid; grid-template-columns:auto auto auto auto auto auto auto auto auto auto auto auto auto; grid-gap: 2px; background-color: #2196F3; padding: 10px;
}
.grid-container > div { background-color: lightblue; text-align: center; padding: 10px ; font-size: 30px; }
.item1 { grid-row: 1 / 4; }
</style> </head> <body> <form action="" method ="post" name="MyForm" > <input type="submit" name="submit" id="submit" value="ตกลง"> <table class="table" id="demo1" style="background-color:#E6E6E6" > <tr > <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> </table>
</form> <div class="grid-container">
<div onclick="myFunction(this)" class="item1" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';" font color="red">0</div>
<div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';"><font color=red>3</font></div>
<div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">6</div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';"><font color=red>9</font></div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';"><font color=red>12</font></div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">15</div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';"><font color=red>18</font></div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';"><font color=red>21</font></div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">24</div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';"><font color=red>27</font></div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';"><font color=red>30</font></div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">33</div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">36</div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">2</div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';"><font color=red>5</font></div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">8</div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">11</div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';"><font color=red>14</font></div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">17</div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">20</div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';"><font color=red>23</font></div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">26</div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">29</div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';"><font color=red>32</font></div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">35</div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';"><font color=red>1</font></div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">4</div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';"><font color=red>7</font></div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">10</div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">13</div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';"><font color=red>16</font></div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';"><font color=red>19</font></div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">22</div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';"><font color=red>25</font></div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">28</div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">31</div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';"><font color=red>34</font></div>
</div> <script> const myFunction = i => $("#demo1 td:empty:first").html($(i).html()) </script> <table class="table" id="demo1" style="background-color:#E6E6E6" > <tr > <td>ทุก5ครั้ง</td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td>ถูก</td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td>ผิด</td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> </table>
</body> </html>
|
|
|
15
|
พัฒนาเว็บไซต์ / Programming / Re: ผมจะสร้างสีเหลี่ยมเป็นเเถวเเบบนี้ยังไงครับ php
|
เมื่อ: 23 กันยายน 2019, 10:00:04
|
ถามต่ออีกหน่อยครับ ถ้ากดตัวเลขทุก 4 ครั้ง ให้มันโชว์พื้นหลังสีเหลืองกรอบที่1 เหมือนเราเอาเม้าส์ชี้ที่ตัวเลขครับ เเล้วพอกดครั้งที่ 5 ให้กรอบหายเเล้วเเสดงในตารางข้างล่างด้วยครับ ต้องเขียนเช็คประมาณไหนบ้างครับ ขอบคุณ <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <!-- <link rel="stylesheet" type="text/css" href="style.css"> -->
<style> *{ margin: 0; padding: 0; } .Analysis {
width:70%; height: 139px; margin:0 auto; border:1px solid #000000; margin-bottom: 100px; }
.containertt { width:70%; height: 50px; margin:0 auto; text-align: center; } table, th { border: 1px solid black; border-collapse: collapse; text-align: center; } td { border: 1px solid black; border-collapse: collapse; width: 50px; height: 50px; font-size: 30px; }
.grid-container { display: grid; grid-template-columns:auto auto auto auto auto auto auto auto auto auto auto auto auto; grid-gap: 2px; background-color: #2196F3; padding: 10px;
}
.grid-container > div { background-color: lightblue; text-align: center; padding: 10px ; font-size: 30px; }
.item1 { grid-row: 1 / 4; }
</style> </head> <body> <form action="" method ="post" name="MyForm" > <input type="submit" name="submit" id="submit" value="ตกลง"> <table class="table" id="demo1" style="background-color:#E6E6E6" > <tr > <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> </table>
</form> <div class="grid-container">
<div onclick="myFunction(this)" class="item1" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';" font color="red">0</div>
<div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';"><font color=red>3</font></div>
<div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">6</div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';"><font color=red>9</font></div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';"><font color=red>12</font></div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">15</div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';"><font color=red>18</font></div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';"><font color=red>21</font></div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">24</div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';"><font color=red>27</font></div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';"><font color=red>30</font></div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">33</div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">36</div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">2</div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';"><font color=red>5</font></div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">8</div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">11</div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';"><font color=red>14</font></div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">17</div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">20</div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';"><font color=red>23</font></div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">26</div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">29</div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';"><font color=red>32</font></div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">35</div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';"><font color=red>1</font></div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">4</div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';"><font color=red>7</font></div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">10</div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">13</div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';"><font color=red>16</font></div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';"><font color=red>19</font></div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">22</div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';"><font color=red>25</font></div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">28</div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">31</div> <div onclick="myFunction(this)" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';"><font color=red>34</font></div>
</div> <script> const myFunction = i => $("#demo1 td:empty:first").html($(i).html()) </script> <table class="table" id="demo1" style="background-color:#E6E6E6" > <tr > <td>ทุก5ครั้ง</td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td>ถูก</td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td>ผิด</td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> </table>
</body> </html>
|
|
|
16
|
พัฒนาเว็บไซต์ / Programming / Re: ผมจะสร้างสีเหลี่ยมเป็นเเถวเเบบนี้ยังไงครับ php
|
เมื่อ: 18 กันยายน 2019, 19:11:28
|
ช่วยหน่อยครับ ผมจะให้กดเลขเเล้วให้มันเเสดงในกรอบต้องทำยังไงครับ ถ้าเรากดเลขข้างล่าง ก็จะรันในสีเหลี่ยมด้านบนไปเรื่อยๆครับ <!DOCTYPE html> <html> <head> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body>
<form action="" method ="post" name="MyForm" > <input type="submit" name="submit" id="submit" value="ตกลง">
<div class="Analysis"> <table style="width:100%"> <tr> <td id="demo1"></td> <td id="resultroulette-0-0"></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> </table> </div>
</form>
<script> function myFunction() { document.getElementById("demo1").innerHTML = "1";
} </script>
<div class="flex-container"> <div><p value="2" onclick="myFunction()" >1</p></div> <div><p onclick="myFunction()">2</p></div> <div><p onclick="myFunction()">3</p></div> <div><p onclick="myFunction()">4</p></div> <div><p onclick="myFunction()">5</p></div> <div><p onclick="myFunction()">6</p></div> <div><p onclick="myFunction()">7</p></div> <div><p onclick="myFunction()">8</p></div> <div><p onclick="myFunction()">9</p></div> </div>
</body> </html>
อันนี้ style ครับ <style> *{ margin: 0; padding: 0; } .Analysis {
width:70%; height: 139px; margin:0 auto; border:1px solid #000000; margin-bottom: 100px; }
.containertt { width:70%; height: 50px; margin:0 auto; text-align: center; } table, th { border: 1px solid black; border-collapse: collapse; text-align: center; } td { border: 1px solid black; border-collapse: collapse; width: 41px; height: 43px; }
.flex-container { display: flex; flex-wrap: nowrap; background-color: DodgerBlue; }
.flex-container > div { background-color: #f1f1f1; width: 100px; margin: 10px; height: 100px; text-align: center; font-size: 30px; }
.flex-container1 { margin-top: 100px; display: flex; flex-wrap: nowrap; background-color: DodgerBlue; }
.flex-container1 > div { background-color: #f1f1f1; width: 100px; height: 100px; margin: 10px; text-align: center; font-size: 30px; }
</style>
|
|
|
20
|
พัฒนาเว็บไซต์ / Programming / ถ้ากดตัวเลขทุก 5 ครั้ง ให้มันเเสดงที่ตารางล่างยังไงครับ
|
เมื่อ: 17 กันยายน 2019, 15:49:47
|
ตอนนี้ผมติดอยู่2ที่ครับ พอกดเลข4ครั้งเเล้วมันขึ้นสีพื้นหลัง พอกดครั้งที่5 ถ้าเรากดเลขที่ขึ้นสีพื้นหลังให้ขึ้นรูปติ้กถูก ถ้าไม่ได้กดเลขที่มีสีพื้นหลังให้ขึ้นรูปติ้กผิด ถ้ากดตัวเลขทุก 5 ครั้ง ให้มันเเสดงที่ตารางล่างยังไงครับ ตอนนี้กดมันขึ้นเเต่ช่องเเรกครับ พอเขียนประมาณไหนครับ <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <!-- <link rel="stylesheet" type="text/css" href="style.css"> -->
<style> *{ margin: 0; padding: 0; }
.Analysis {
width:70%; height: 139px; margin:0 auto; border:1px solid #000000; margin-bottom: 100px;
}
.containertt {
width:70%; height: 50px; margin:0 auto; text-align: center;
} table, th { border: 1px solid black; border-collapse: collapse; text-align: center; } td { border: 1px solid black; border-collapse: collapse; width: 50px; height: 50px;
}
.grid-container { display: grid; grid-template-columns:auto auto auto auto auto auto auto auto auto auto auto auto auto; grid-gap: 2px; background-color: #2196F3; padding: 10px;
}
.grid-container > div { background-color: lightblue; text-align: center; padding: 10px ; font-size: 30px; }
#item1 { grid-row: 1 / 4; }
</style> </head> <body>
<table class="table" id="demo1" style="background-color:#E6E6E6"> <tr > <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> </table>
<div class="grid-container" >
<div onclick="myFunction(this)" id="item1" class="test0"><font color=#84FB84>0</font></div>
<div onclick="myFunction(this)" class="test1" id="test2">2</div>
<div onclick="myFunction(this)" class="test1" id="test4">4</div> <div onclick="myFunction(this)" class="test1" id="test6"><font color=red>6</font></div> <div onclick="myFunction(this)" class="test1"><font color=red>8</font></div> <div onclick="myFunction(this)" class="test2">10</div> <div onclick="myFunction(this)" class="test2"><font color=red>12</font></div> <div onclick="myFunction(this)" class="test2"><font color=red>14</font></div> <div onclick="myFunction(this)" class="test2">16</div> <div onclick="myFunction(this)" class="test3"><font color=red>18</font></div> <div onclick="myFunction(this)" class="test3"><font color=red>20</font></div> <div onclick="myFunction(this)" class="test3">22</div> <div onclick="myFunction(this)" class="test3">24</div> <div onclick="myFunction(this)" class="test1" id="test1">1</div> <div onclick="myFunction(this)" class="test1" id="test3"><font color=red>3</font></div> <div onclick="myFunction(this)" class="test1" id="test5">5</div> <div onclick="myFunction(this)" class="test1">7</div> <div onclick="myFunction(this)" class="test2"><font color=red>9</font></div> <div onclick="myFunction(this)" class="test2">11</div> <div onclick="myFunction(this)" class="test2">13</div> <div onclick="myFunction(this)" class="test2"><font color=red>15</font></div> <div onclick="myFunction(this)" class="test3">17</div> <div onclick="myFunction(this)" class="test3">19</div> <div onclick="myFunction(this)" class="test3">21</div> <div onclick="myFunction(this)" class="test3">23</div>
<!-- <div onClick="onClick()" class="test" id="test1" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">333</div>
<div class="test"id="test2" onMouseover="this.style.backgroundColor='yellow';" onMouseout="this.style.backgroundColor='lightblue';">444</div> <div class="test" id="test3" mouseenter="this.style.backgroundColor='yellow';" mouseleave="this.style.backgroundColor='lightblue';" >555</div> -->
</div> <script> myFunction = i => $("#demo1 td:empty:first").html($(i).html()) var tooClick = 0; var totalClick = 0; // จำนวนคลิกทั้งหมด var evenClick = 0; // จำนวนคลิกเลขคู่ var oddClick = 0; // จำนวนคลิกเลขคี่ var result=false; var backgound=""; var clicks = 0; var po = 0;
function clickCount() { clicks = 1; //ตรงนี้ใส่ clicks = 1; po = Math.floor((Math.random() * 10) 1); }
function changBackground() { return backgound = clicks==4 ? "backgound:yellow" : ""; }
function t1() { po=0; document.getElementById("t1").innerHTML = $(this).text(); } function t2() { po=1; document.getElementById("t2").innerHTML = $(this).text(); }
function reset() { $(".test0").css("background-color", "lightblue"); $(".test1").css("background-color", "lightblue"); $(".test2").css("background-color", "lightblue"); $(".test3").css("background-color", "lightblue"); evenClick=0; oddClick=0; tooClick=0; ma=''; clicks=0; result=false; return; } function pop() { alert("Hello! I am an alert box!"); window.location.reload(); }
$(function(){ $(".test0,.test1,.test2,.test3").click(function(){
clickCount();
document.getElementById("clicks").innerHTML = clicks; document.getElementById("demo").innerHTML = $(this).text(); document.getElementById("ran").innerHTML = po;
if ($(this).text()%2==0) { evenClick ; //ตรงนี้ใส่ evenClick บวกบวก ; oddClick ; //ตรงนี้ใส่ oddClick บวกบวก ; if((evenClick % 4 ==0)){
if ((po%2==0) ) { $(".test1").css("background-color", "yellow");
}
if (po%2==1) { $(".test3").css("background-color", "#80E12A");
}
}else if(oddClick % 5 ==0){ document.getElementById("golf").innerHTML = $(this).text();
reset(); }
}else if ($(this).text()%2==1) { oddClick ; //ตรงนี้ใส่ oddClick บวกบวก ; evenClick ; //ตรงนี้ใส่ evenClick บวกบวก ; if(oddClick % 4 ==0){ if (po%2==0) { $(".test2").css("background-color", "red"); }else if (po%2==1) { $(".test3").css("background-color", "#80E12A"); } }else if(oddClick % 5 ==0){ document.getElementById("golf").innerHTML = $(this).text();
reset(); } } if (clicks>60) { pop(); }
}); }); </script>
<p>Clicks: <a id="clicks">0</a></p> <p id="demo"></p> <p>ran: <a id="ran">0</a></p> <p>ma: <a id="ma">0</a></p> <p>r1: <a id="r1">0</a></p> <p>r2: <a id="r2">0</a></p> <p>r3: <a id="r3">0</a></p> <p>r4: <a id="r4">0</a></p> <p>t1: <a id="t1">0</a></p> <p>t2: <a id="t2">0</a></p> </script> <table class="table" id="demo2" style="background-color:#E6E6E6" > <tr> <td>ครั้งที่5</td> <td id="golf"></td> <td id="golf"></td> <td id="golf"></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> </table>
<table> <tr> <td>ถูก</td> <td id="yes"></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td>ผิด</td> <td id="no" ></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> </table>
</body> </html>
|
|
|
|
|