|
|
|
Click ที่ลิ้งค์ เปลี่ยนรูปแบบ Style Sheet ปรับเปลี่ยนเอกสารหน้าเว็บ ด้วย JavaScript |
|
|
|
|
|
|
|
Code (PHP)
<html>
<head>
<title>ThaiCreate.Com Tutorial</title>
<style type="text/css">
.css1 {
font-size: 11px;
font-weight: bold;
color: #000000;
}
.css2 {
font-size: 20;
font-weight: bold;
color: #FF0000;
}
</style>
</head>
<body>
<form name="frmMain" action="" method="post">
<input type="text" name="txtText" value="ThaiCreate.Com" class="css1" OnFocus="document.frmMain.txtText.className='css2';" OnBlur="document.frmMain.txtText.className='css1';">
<br>
<input type="button" name="btn1" value="Stylesheet 1" onClick="document.frmMain.txtText.className='css1';">
<input type="button" name="btn2" value="Stylesheet 2" onClick="document.frmMain.txtText.className='css2';">
</form>
</body>
</html>
|
|
|
|
|
Date :
2011-06-09 21:00:35 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (style1.css)
.css {
font-size: 11px;
font-weight: bold;
color: #000000;
}
Code (style2.css)
.css {
font-size: 20;
font-weight: bold;
color: #FF0000;
}
Code (PHP)
<html>
<head>
<title>ThaiCreate.Com Tutorial</title>
<link rel="stylesheet" href="style1.css" id="stylesheet">
<script type="text/javascript">
function changeStyle(url) {
document.getElementById('stylesheet').href = url;
}
</script>
</head>
<body>
<form name="frmMain" action="" method="post">
<input type="text" name="txtText" value="ThaiCreate.Com"class="css">
<br>
<input type="button" name="btn1" value="Stylesheet 1" onClick="changeStyle('style1.css');">
<input type="button" name="btn2" value="Stylesheet 2" onClick="changeStyle('style2.css');">
</form>
</body>
</html>
|
|
|
|
|
Date :
2011-06-09 21:01:42 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|