"Thay đổi màu nền cho Blogspot khi rê chuột (Onmouseover)"

1. Đăng nhập vào tài khoản Blogger
2. Vào phần thiết kế (Design)
3. Chọn chỉnh sửa HTML (Edit HTML)
4. Chèn code bên dưới vào ngay sau thẻ <head>
<script type="text/javascript">
function changeColor(color)
{
document.getElementById("changecolor").style.background=color;
}
</script>
function changeColor(color)
{
document.getElementById("changecolor").style.background=color;
}
</script>
5. Bây giờ bạn tìm đến thẻ <body>
6. Bạn thay nó thành code bên dưới
<body id="changecolor">
7. Save template lại và trở về phần tử trang
8. Thêm 1 HTML/Javascript và thêm vào code bên dưới
<table><tr>
<td width="12px" height="12px" bgcolor="red" onmouseover="changeColor('red')"> </td>
<td width="12px" height="12px" bgcolor="blue" onmouseover="changeColor('blue')"> </td>
<td width="12px" height="12px" bgcolor="green" onmouseover="changeColor('green')"> </td>
<td width="12px" height="12px" bgcolor="orange" onmouseover="changeColor('orange')"> </td>
<td width="12px" height="12px" bgcolor="violet" onmouseover="changeColor('violet')"> </td>
<td width="12px" height="12px" bgcolor="yellow" onmouseover="changeColor('yellow')"> </td>
<td width="12px" height="12px" bgcolor="brown" onmouseover="changeColor('brown')"> </td>
</tr></table>
<td width="12px" height="12px" bgcolor="red" onmouseover="changeColor('red')"> </td>
<td width="12px" height="12px" bgcolor="blue" onmouseover="changeColor('blue')"> </td>
<td width="12px" height="12px" bgcolor="green" onmouseover="changeColor('green')"> </td>
<td width="12px" height="12px" bgcolor="orange" onmouseover="changeColor('orange')"> </td>
<td width="12px" height="12px" bgcolor="violet" onmouseover="changeColor('violet')"> </td>
<td width="12px" height="12px" bgcolor="yellow" onmouseover="changeColor('yellow')"> </td>
<td width="12px" height="12px" bgcolor="brown" onmouseover="changeColor('brown')"> </td>
</tr></table>
Chỉnh code: Bạn hãy thay các tên màu trong code trên thành màu ưa thích của bạn, ở đây mình sử dụng tên màu bạn cũng có thể thay chúng thành mã màu tương ứng như #0000ff, bạn tham khảo bảng mã màu tại đây.
9. Save tiện ích lại
Chúc bạn thành công
0 nhận xét:
Đăng nhận xét