MyBB Community Forums

Full Version: Color Picker
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Can someone assist me in coding up a colour picker for one of my themes.
I'm no good at jQuery and dont know where to start.
Although ive found this posted around; http://www.eyecon.ro/colorpicker/

I will happily pay for your time.

Thank you
Yep Ive read it Wink But apart from finding the link in the OP I couldn't continue any further.
(2012-08-24, 12:12 PM)BleepyEvans Wrote: [ -> ]Yep Ive read it Wink But apart from finding the link in the OP I couldn't continue any further.

I've debated on giving this a shot myself, but it's tricky. Undecided
Try checking out the jQuery tuts on Codecademy. Once you know the basics it's really easy to understand how the color picker works.
Well, so long as you're pretty good with jQuery this isn't too much trouble. Basically set all the elements you want changed to a variable, then inside an if statement (If a color cookie has been set) change those element's CSS.

If you mean just showing the color picker, simply upload the files to your server, then you'll want to include the files in your headerinclude:

<script type="text/javascript" src="{$mybb->settings['bburl']}/colorpicker/js/colorpicker.js"></script>
<link rel="stylesheet" media="screen" type="text/css" href="{$mybb->settings['bburl']}/colorpicker/css/colorpicker.css" />

then invoke it by adding this to your code somewhere:

<div id="colorSelector"><div style="background-color: #DDD"></div></div>
<div id="colorpickerHolder"></div>

The plugin comes with some pretty useful stuff as well, like onChange.