SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Jan 2007
    Posts
    130
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    A challenge [Fixing a very nice color picker script]

    Hi, i've been working to get this script to work and it works in Firefox.
    In IE though the PNG background of the big square color picker (click button on the right) does not change to the color of the color slider, it's always grey instead
    The big square color picker area exists out of a transparent black and white gradient png and a white background png for the color (wich i think acts as a placeholder since that area has to change color).

    I figure that somewhere in the process of the script something is not working for IE but i find it hard to figure out what it is.

    Please help me figure this out.

    A demo of the script can be seen at the bottom of this page Demo and tutorial
    My working sample can be downloaded from here Download Sample

  2. #2
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Interesting. I got it working *sometimes* in IE, using the original blank.gif (the one called blank_old.gif) and a lot of mucking around. In the end the html file looked like:
    Code:
    <html>
    <head>
    <style type="text/css">
    img {
    	behavior: url(pngbehavior.htc);
    }
    </style>
    <script src="colorpicker.js" type="text/javascript"></script>
    <script type="text/javascript">
    function init(){
    	var inp1 = document.getElementById('input1');
    	var inp2 = document.getElementById('input2');
    
    	if(inp1) attachColorPicker(inp1);
    	if(inp2) attachColorPicker(inp2);
    	
    }
    window.onload = init;
    </script>
    </head>
    <body>
    <input id="input1" /><br /><br />
    <input id="input2" />
    </body>
    </html>
    There are 2 versions of pngbehavior.htc floating around. I ended up having some luck with the 1.5kb one as opposed to 3.5kb.

    Sometimes, when you click on a text box, you get a white bar instead of the picker. I dunno why it does that. Proceed at your own risk


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
  •