![]() |
How do I change the .body background color with Javascript?
As per title. I would like to add an option to let users change the style's .body background color in their usercp. And it should be saved in their options, so they see that color until they change it again.
|
Hi,
i've been looking at something like this myself, here is a very basic example 1st you need to save this code as a Javascript so copy it to your notepad and save it as "Backcolor.js" Code:
function change_it() { Then enter the code below, between the <body> and </body> tags where you want the select box and button to appear, ideally in the footer or header templates Code:
<form action="#" onsubmit="return change_it();"> i've done this very basic, but you can change the colors in the backcolor.js file just change the case 1, 2 and 3 options with a new hex color #FFFFFF You can get a nice selection of hexcolors here http://www.december.com/html/spec/colorsafe.html This is what you get, Mind you it won't work well on my forum as its fluid, but it'll work well with fixed forums https://vborg.vbsupport.ru/external/2008/12/4.png https://vborg.vbsupport.ru/external/2008/12/5.png https://vborg.vbsupport.ru/external/2008/12/6.png Remember you can change these colors, I've just done 3 as an example, But you can add as many as you want and with millions of combinations by using a color Hex chart. Have Fun ;) To see the new template edit in the mods forum https://vborg.vbsupport.ru/showthread.php?t=200096 |
All times are GMT. The time now is 03:28 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|