It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Partner Sites
Board index Programming JavaScript Forum

Color picker for different div.

Color picker for different div.

Postby peuplarchie on Sat Jul 11, 2009 10:22 pm

Good day to you all,

here I have a javascript/css color picker.

The script is changing the background color of a div.

What I would like its to be able to have 6 div that could independently change the background color of them.

Here is the main functions.

ALL I need it's to be able to tell to the function which div to change :

[HTML]

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

<div id="colorbox" style="width: 100px; border: 1px solid gray; padding: 10px; background-color: #F1FFCC" onclick="javascript:toggle('plugin')">
<br />

</div>

<br/>

<div id="colorbox1" style="width: 100px; border: 1px solid gray; padding: 10px; background-color: #F1FFCC" onclick="javascript:toggle('plugin')">
<br />

</div>
<br/>
<div id="colorbox2" style="width: 100px; border: 1px solid gray; padding: 10px; background-color: #F1FFCC" onclick="javascript:toggle('plugin')">
<br />

</div>
<br/>
<div id="colorbox3" style="width: 100px; border: 1px solid gray; padding: 10px; background-color: #F1FFCC" onclick="javascript:toggle('plugin')">
<br />

</div>
<br/>
<div id="colorbox4" style="width: 100px; border: 1px solid gray; padding: 10px; background-color: #F1FFCC" onclick="javascript:toggle('plugin')">
<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 background = '#' + v;

}



loadSV(); updateH('F1FFCC');



</script>

[/HTML]


THNAKS !
peuplarchie
 
Posts: 1
Joined: Mon Apr 20, 2009 2:05 am

Return to JavaScript Forum

Who is online

Users browsing this forum: No registered users and 4 guests