vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=200097

Multi-Choice background color using Javascript
by UKBusinessLive
29 Dec 2008 17:33

4 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 http://www.vbulletin.org/forum/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"


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

then you upload the backcolor.js file to same directory as the Web page on which you will use the script (ideally your Forum Root)

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 ;)


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

What that will do is give your users a dropdown box with a Change Color button ( for the english spelling please change the above code here <input type="submit" value="Change Color" /> )

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://www.vbulletin.org/forum/external/2008/12/4.png
https://www.vbulletin.org/forum/external/2008/12/5.png
https://www.vbulletin.org/forum/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

;)

UKBusinessLive 29 Dec 2008 17:38

:D Reserved :up:


All times are GMT. The time now is 12:09.

Powered by vBulletin® Version 3.8.14
Copyright © 2020, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.