PDA

View Full Version : ColorJack Script help



toniomorais
07-19-2007, 09:35 AM
1) Script Title:
ColorJack DHTML color picker
2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...jack/index.htm

3) Describe problem:
The color picker shows up automatically when the page loads. Is there a way to keep it closed until the person clicks on the link to open the picker?

mburt presented this solution:
Code:

<body onload="toggle('element')">

that works very fine, but....

My question:

I have also in the same htm page the sdmenu script from DD. This makes colorjack script load even when I put this code:
<body onload="toggle('element')">

Is there another way to colorjack don't show up automatically when the page loads?
I know that two or more scripts in the same page could mess all but I also think there is a solution but I canīt find it. Please help...


Thank you,

toniomorais
07-25-2007, 11:18 AM
It's me again...

Ok.

Maybe there is another solution to use both scripts in one html page wiyhout conflict and open in page load.

I noticed that the place where the color picker opens it's given by x y z coordinates.

The problem is that the placewhere it opens it's diferent from monitor resolution to monitor resolution.

Example: If i have a 800x600 monitor resolution the color picker opens right where I want but if I change to another resolution the color picker opens in a diferent place because he uses the x y z coordinates.

Well I canīt guess what resolution the visitor have in the computer without adding another script (more conflict maybe).

Any sugestion?

Basically I would like to choose the place where the color picker open in page load having in mind that the monitor resolution of each visitor is diferent.

Please help me out...

msmedley
10-29-2007, 11:13 PM
To prevent the color picker from being displayed, put it in an invisible DIV:



<div id="colorpicker" style="display:none">
<div id="plugin" onmousedown="HSVslide('drag','plugin',event)" style="TOP: 100px; LEFT: 600px; Z-INDEX: 20;">
<div id="plugHEX" onmousedown="stop=0; setTimeout('stop=1',100);">F1FFCC</div><div id="plugCLOSE" onmousedown="toggle('plugin')">X</div><br>

<div id="SV" onmousedown="HSVslide('SVslide','plugin',event)" title="Saturation + Value">
<div id="SVslide" style="TOP: -4px; LEFT: -4px;"><br /></div>
</div>
<form id="H" onmousedown="HSVslide('Hslide','plugin',event)" title="Hue">
<div id="Hslide" style="TOP: -7px; LEFT: -8px;"><br /></div>
<div id="Hmodel"></div>
</form>
</div>
</div>


Then add some Javascript:

<script type="text/javascript">
function showcolorpicker()
{
var colorpicker = document.getElementById( "colorpicker" );
colorpicker.style.display = "block";
var plugin = document.getElementById( "plugin" );
plugin.style.display = "block";
}
</script>


and then add to the BODY tag:


<body onload="showcolorpicker();">