Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
variabalize a function ?
Old 07-09-2009, 10:40 PM variabalize a function ?
Junior Talker

Posts: 2
Trades: 0
Good day to you all,
I'm working on a color picker in javascript and css.
I have found a script that works, but my problem it is made to choose only 1 color, how can I make my code to work for 5.

I know that php is a server-side language, but I think I could be able to modify my code in that sense.

Here is my code :
PHP Code:

<!--Sample DIV to show selected color -->

<
div id="colorbox" style="width: 100px;  border: 1px solid gray; padding: 10px; background-color: #F1FFCC">
<
br />

</
div>

<
br/>

<
div id="colorbox1" style="width: 100px;  border: 1px solid gray; padding: 10px; background-color: #F1FFCC">
<
br />

</
div>
<
br/>
<
div id="colorbox2" style="width: 100px;  border: 1px solid gray; padding: 10px; background-color: #F1FFCC">
<
br />

</
div>
<
br/>
<
div id="colorbox3" style="width: 100px;  border: 1px solid gray; padding: 10px; background-color: #F1FFCC">
<
br />

</
div>
<
br/>
<
div id="colorbox4" style="width: 100px;  border: 1px solid gray; padding: 10px; background-color: #F1FFCC">
<
br />

</
div>


<
script type="text/javascript">



//*** CUSTOMIZE mkcolor() function below to perform the desired action when the color picker is being dragged/ used

//*** Parameter "v" contains the latest color being selected

function mkColor(v){

//** In this case, just update DIV with ID="colorbox" so its background color reflects the chosen color

$S('colorbox').background='#'+v;

}



loadSV(); updateH('F1FFCC');



</script> 
Thanks !
peuplarchie is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-10-2009, 12:23 PM Re: variabalize a function ?
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
Sorry, you're not leaving us much of a clue as to how to help you. For one thing we have no way of knowing what the loadSV() or updateH() functions do.

What does any of this have to do with PHP?
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Reply     « Reply to variabalize a function ?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11173 seconds with 12 queries