|
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 !
|