Current location: Hot Scripts Forums » Programming Languages » PHP » variabalize a function ?


variabalize a function ?

Reply
  #1 (permalink)  
Old 07-09-09, 09:03 PM
peuplarchie's Avatar
peuplarchie peuplarchie is offline
Newbie Coder
 
Join Date: Nov 2008
Posts: 64
Thanks: 1
Thanked 0 Times in 0 Posts
Post variabalize a function ?

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 !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[2005] StartPosition for CommonDialogs? tim8w Windows .NET Programming 10 01-08-09 04:39 AM
Parsing XML dodotopia PHP 1 02-08-06 04:51 PM
ASP upload prob minority ASP 1 06-27-05 09:35 AM
PHP Error Fairnie PHP 8 06-26-04 08:15 AM
Help trim code down TheLaughingBandit JavaScript 0 09-02-03 10:50 AM


All times are GMT -5. The time now is 05:06 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.