Results 1 to 3 of 3

Thread: ColorJack Script help

  1. #1
    Join Date
    Jun 2007
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default ColorJack Script help

    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,

  2. #2
    Join Date
    Jun 2007
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default New aproach

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

  3. #3
    Join Date
    Oct 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    To prevent the color picker from being displayed, put it in an invisible DIV:

    Code:
    <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:
    Code:
    <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:

    Code:
    <body onload="showcolorpicker();">

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •