HERE I WILL BE GIVING YOU THE CODE SO THAT WHEN YOU COPY THIS CODE IN YOUR HTML CODE YOU CAN ADD A BUTTON SO THAT THE VISITORS WILL BE HAVING OPTION TO CHANGE THE COLOR OF THE BLOG ACCORDING TO THEIR WISH
<div class="widget-content">
<center><b>Choose your favourite color to this blog</b></center>
<br/>
<script type="text/javascript">
function bgChange(bg)
{
document.body.style.background=bg;
}
</script>
<table border="1" width="100%" height="20">
<tbody><tr>
<td onclick="bgChange('#8b008b')" bgcolor="#8B008B">
</td>
<td onclick="bgChange('#9400d3')" bgcolor="#9400D3">
</td>
<td onclick="bgChange('#008080')" bgcolor="#008080">
</td>
<td onclick="bgChange('#808080')" bgcolor="#808080">
</td>
<td onclick="bgChange('#cd853f')" bgcolor="#CD853F">
</td>
<td onclick="bgChange('#2f4f4f')" bgcolor="#2F4F4F">
</td>
<td onclick="bgChange('#dc143c')" bgcolor="#DC143C">
</td>
<td onclick="bgChange('#4b0082')" bgcolor="#4B0082">
</td>
<td onclick="bgChange('#a52a2a')" bgcolor="#A52A2A">
</td>
</tr></tbody></table>
</div>
NOTE :APART FROM ALL THESE COLORS YOU CAN ADD MORE NUMBER OF COLORS BY CHANGING THE VALUE IN bgChange AND bgColor TO YOUR REQUIRED COLOR CODE
<div class="widget-content">
<center><b>Choose your favourite color to this blog</b></center>
<br/>
<script type="text/javascript">
function bgChange(bg)
{
document.body.style.background=bg;
}
</script>
<table border="1" width="100%" height="20">
<tbody><tr>
<td onclick="bgChange('#8b008b')" bgcolor="#8B008B">
</td>
<td onclick="bgChange('#9400d3')" bgcolor="#9400D3">
</td>
<td onclick="bgChange('#008080')" bgcolor="#008080">
</td>
<td onclick="bgChange('#808080')" bgcolor="#808080">
</td>
<td onclick="bgChange('#cd853f')" bgcolor="#CD853F">
</td>
<td onclick="bgChange('#2f4f4f')" bgcolor="#2F4F4F">
</td>
<td onclick="bgChange('#dc143c')" bgcolor="#DC143C">
</td>
<td onclick="bgChange('#4b0082')" bgcolor="#4B0082">
</td>
<td onclick="bgChange('#a52a2a')" bgcolor="#A52A2A">
</td>
</tr></tbody></table>
</div>
NOTE :APART FROM ALL THESE COLORS YOU CAN ADD MORE NUMBER OF COLORS BY CHANGING THE VALUE IN bgChange AND bgColor TO YOUR REQUIRED COLOR CODE
No comments:
Post a Comment