Color Picker

25 views
Skip to first unread message

DAZ

unread,
Nov 20, 2011, 10:41:15 AM11/20/11
to RightJS
Hi,

I'm using the Colorpicker widget to change the color of a title and
currently have this code:

<input name='color' id='color' type='text' value='#ff6' />
<a href='#' data-colorpicker='{updateColor:"title",
update:"color"}'>set</a>

Just wondering if it is possible to not show the preview and rgb
values?
I have tried the following css:

div.rui-colorpicker div.controls{display:none;}

But it is still showing.

Also, how do you set a default color? In the example above, I wanted
#ff6 as the default value, but this isn't the case - when I click on
the 'set' link it always defaults to white.

cheers,

DAZ

DAZ

unread,
Nov 22, 2011, 3:50:42 PM11/22/11
to RightJS
I'm finding it very hard to style this widget ...

How do I set the initial position it appears at? (at the moment it
jumps into the top left of the screen)

It seems that I can't get the contols to just 'disappear' as the
styling of the rest of the widget depends on them being there (I
think).

I'd like to hide the actual values and just make it more visual (to
explain a little why I want to do this).

cheers,

DAZ

Nikolay Nemshilov

unread,
Nov 23, 2011, 2:35:17 AM11/23/11
to rig...@googlegroups.com
Hi DAZ,

Sorry for a bit of a delay, having busy time in here.

Regarding div.rui-colorpicker div.controls { display: none; }
I've just checked it, works just fine. Make sure that you add your custom styles _after_ you include the colorpicker javascript on the page. Otherwise it will overwrite your styles.

Then default color. It should read the input's value. But now, when I'm looking at it, it seems there is a bug, it works with the standard 'onfocus' handler, but falls to white when you use an external trigger.

And regarding the initial position, by default it will use the position of your input field. If you need something else you will need to instantiate a Colorpicker object and place it on the page manually. See the 'inlined' version on the demo page

--
Cheers,
Nikolay

> --
> You received this message because you are subscribed to the Google Groups "RightJS" group.
> To post to this group, send email to rig...@googlegroups.com.
> To unsubscribe from this group, send email to rightjs+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rightjs?hl=en.
>

DAZ

unread,
Dec 1, 2011, 5:26:25 PM12/1/11
to RightJS
Hi Nik,

Sorry for the delay in replying too! Too busy with other stuff, but
thanks for your reply.

It was the obvious thing that was the problem - my stylesheet came
before the js, so problem solved.

Yes it is definitely defaulting to white when it appears, would be
good if it was the initial color instead.

One other question - at the moment I'm setting the text colour of the
#title element with the color picker. I'd also like to set the text-
shadow property of #title to a color that is 20% darker than the color
selected, is this possible?

cheers,

DAZ

Reply all
Reply to author
Forward
0 new messages