TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

April 18, 2024, 01:20:58 AM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,164
  • Total Topics: 21,219
  • Online today: 180
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 179
  • Total: 179

Color Picker HEX, RGB

Started by jp, October 10, 2006, 10:44:32 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Crip

COLOR PICKER FOR YOU!!
You'll want this on your Portal, very handy tool indeed!

Demo

Unzip, upload all files, folders in order to your Forum Root!
Create a New Article: -
add in an IFrame -

<iframe src="demo.htm" width="!00%" height="850" border="0"></iframe>


You'll never go looking for a color chart again...


<h3>Customization</h3>
<p align="justify">While this script references multiple .js files, to integrate the color picker with your form in the fashion above, you do not need to be bothered with modifying any of these files. Instead, there are only two changes you need to make to the code of "demo.htm" to integrate the color picker into your page:</p>

1) Locate the code:

<p align="justify">ddcolorposter.fillcolorbox("colorfield1", "colorbox1") //PREFILL "colorbox1" with hex value from "colorfield1"</p>
<p align="justify">ddcolorposter.fillcolorbox("colorfield2", "colorbox2") //PREFILL "colorbox1" with hex value from "colorfield1"</p>



<p align="justify">These two lines are used to prefill the color boxes to the right of the form fields in question with the color currently inside the field when the page first loads. Without this code, when your page loads, the color boxes will not be initially filled with the color values inside the form fields.</p>

<p align="justify">There are two fields in the demo, hence two lines. The first parameter of fillcolorbox(), "colorfield1", should be the ID of the form field, while the second parameter, the ID of the matching color box.</p>

<p>See below for more information.</p>

2) Locate the code:

<form>
# <input type="text" id="colorfield1" onFocus="ddcolorposter.echocolor(this, 'colorbox1')"> <span id="colorbox1" class="colorbox">____</span>

# <input type="text" id="colorfield2" onFocus="ddcolorposter.echocolor(this, 'colorbox2')"> <span id="colorbox2" class="colorbox">____</span>
</form>



<p align="justify">This code demonstrates how to integrate the color picker with any form field on your page.</p>
<p align="justify">The key is the add the code:</p>
<p align="justify">onFocus="ddcolorposter.echocolor(this, 'colorbox1')" inside the desired form fields, where "colorbox1" is the ID of color box.</p>

<h2>That's it!</h2>


I have become comfortably numb!

Cripzone | Crip's Free 2.0.2 Themes



G6Cad

Nice Crip, thank you :)
What have happend to your theme header ? all squashed to gether  ???

Crip

I have become comfortably numb!

Cripzone | Crip's Free 2.0.2 Themes



G6Cad

The shrink doesent work for me on the article page, it stays down  ???

RoarinRow

For some reason, it doesn't go to the width of the page even though the code says 100%.

Oh I see the problem, your 100% is !00%   :o

SMF 2.0 RC3
TP 1.0 beta 5-1
Wordpress 3.0

Crip

If you view it on the Forum it's a tad bit wider.. Forum width is set on 82% ! @ RR 
I have become comfortably numb!

Cripzone | Crip's Free 2.0.2 Themes



rbh

thanks for the useful script......and the new smiley. ;)

RoarinRow

Quote from: crip on October 11, 2006, 07:58:02 PM
If you view it on the Forum it's a tad bit wider.. Forum width is set on 82% ! @ RR 

I left mine at 100% and disabled the left and right blocks when viewing the article.   :up:

SMF 2.0 RC3
TP 1.0 beta 5-1
Wordpress 3.0

Crip

I just noticed something with this script, you can click and drag the color box anywhere within the Article.. :)
I have become comfortably numb!

Cripzone | Crip's Free 2.0.2 Themes



copter

Hi

thats a great piece of work is that