Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: Little Color Picker update
mrtickles
Newbie

Posts: 1
Registered: 6/27/2003
Member Is Offline
posted on 6/27/2003 at 02:48 PM Reply With Quote
Little Color Picker update


Hi,

I have been playing with the color picker (which works very well btw) but needed a slight modification.
Basically the parent page had a td containing a block with text which needed to be updated once a color was selected. I spent a fair bit of time playing and am not a native javascript coder so the syntax could probably be done far better. If you update the TCSelect function with the one below and then in your html page modify the following links (I only added the 2 extra options, the first being the id tag of the td/div you want to update and the second you either specify 'font' or 'bg' to update the relevant style) then you can have the parent page physically displaying the color choice.

#######
modified html llink

<a href="javascript:TCP.popup(document.forms['tcp_test'].elements['highbgcolor'],'', document.getElementById('rollover'), 'bg')">

########
update TCSelect function

function TCSelect(c) {
this.field.value = '#' + c.toUpperCase();
if(this.changeType == 'font') {
// change font
this.parent.style.color = this.field.value;
} else {
// background
this.parent.style.background = this.field.value;
}
this.win.close();
}

########
change first few lines of TCPopup

function TCPopup(field, palette, parent, changeType) {
this.field = field;
this.parent = parent;
this.changeType = changeType;

#######
finito

I tested it on IE6 and NS7 and both were fine. Use if you like :o)
Simon
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Product Page
 Product Demonstrations Live Demo
Free Download Free Download
Product Documentation Documentation
Support Forum Support Forum
 

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004