Go down
avatar
Welcome
Cao Học
Cao Học
Tội Trạng : Viết bài không dấu ( 2 lần )
Châm ngôn: : Giao lưu, học hỏi
Tài Sản ($NL) Tài Sản ($NL) : 553390
Bài Viết : 341
Tham Gia : 16/05/2009
Đến từ : VietNam

Menu trình đơn nút lệnh cho phép tùy chỉnh hình nền website Empty Menu trình đơn nút lệnh cho phép tùy chỉnh hình nền website

26/9/2010, 7:49 pm
Code:
<style type='text/css'>
body {
background-repeat:no-repeat;
background-attachment:fixed;
background-position:center;
}
</style>

<script language="JavaScript">

var backImage = new Array();

backImage[0] = "http://c.upanh.com/upload/7/338/LK0.11549939_29781_1.jpg";
backImage[1] = "http://c.upanh.com/upload/7/338/CS0.11549953_29781_1.jpg";
backImage[2] = "http://c.upanh.com/upload/7/338/3L0.11549963_29781_1.jpg";
backImage[3] = "http://c.upanh.com/upload/7/338/VZ0.11549930_29781_1.jpg";


function changeBGImage(whichImage){
if (document.body){
document.body.background = backImage[whichImage];
}
}

function go1(){
if (document.selecter1.select1.options[document.selecter1.select1.selectedIndex].value != "none") {
location = document.selecter1.select1.options[document.selecter1.select1.selectedIndex].value
}
}
</script>

<script type="text/javascript">

document.write('<form name="selecter1"><select name="select1" size=1>');
document.write('<option value=none>Chọn hình nền');
document.write('<option value="javascript:changeBGImage(0)">Blue');
document.write('<option value="javascript:changeBGImage(1)">Brown');
document.write('<option value="javascript:changeBGImage(2)">Green');
document.write('<option value="javascript:changeBGImage(3)">Red');
document.write('</select>');
document.write('<input type="button" value="Áp dụng" onclick="go1()">');
document.write('</form>');

</script>
Về Đầu Trang
Permissions in this forum:
Bạn không có quyền trả lời bài viết