![]() |
Multi-Choice background color using Javascript
1 Attachment(s)
Multi-Choice background color using Javascript
Just a quickie here to give your members a choice of what color to display for the forum Background. I quickly bought this together as a result of this request here https://vborg.vbsupport.ru/showthread.php?t=200086 Firstly, 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 As an example i saved it to the end of my header template, see the pictures ;) 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 need to change the hex values to the colors that you choose for your site, in the javascript file (Hex numbers) and then with the template code (The color names) 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 ;) |
:D Reserved :up:
|
Will the color remain on subsequent visits? Is it stored in a cookie or anything? How about some how making it based off a profile field so it stores it in the user table?
|
Tried, and it works when I click on 'change color'. But when I load another page the new bg color return the default one.
|
There is a way of doing this, i'm just waiting for an email and i'll update the code ;)
|
Is there any news, UKBusinessLive?
|
Didn't really work on my forum.... :erm:
|
It seems to onllt work on the index page, I need to get a more experianced coder to take a look at the code, bear with me i'm working on this :cool:
|
I would suggest making a profile field
so the user can change the background look, in their profile or in the navbar. |
I wonder if we could use this to change styles without reloading :D
|
Quote:
Also I"d like to find out on how to change the "page background". |
is this stuff still working :S
or there is any other mod for this?.. i remember there was a mod for the colors just like vb.org has |
Quote:
https://vborg.vbsupport.ru/showthread.php?t=205755 |
All times are GMT. The time now is 05:49 PM. |
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:
|