ColorSphere (DHTML Control) Internet Explorer <-> Firefox

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • ColorSphere (DHTML Control) Internet Explorer <-> Firefox

    Hi liebe Com.

    Wie fasst jeder begründe ich meine Anmeldung dadurch das ich ein problem habe und nicht weiterkomme :P

    Unten angehängt habe ich ein DHTML Control zur Farbauswahl.

    Im Firefox (wie sollte es auch anderes sein) funktioniert alles tadellos. Benutze ich Internet Explorer kann mann die Maus nicht über das Farbfeld ziehen bzw das kleine runde Bild.

    Sowie ich das sehe wird die variable e irgendwo überschrieben. Eine Lösung habe ich in den 5 Stunden leider nicht gefunden.

    Wäre schön wenn ihr mir da weiterhelfen könntet :)

    Mythli

    Quellcode

    1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    2. <html xmlns="http://www.w3.org/1999/xhtml">
    3. <head>
    4. <title>ColorJack: DHTML Color Picker</title>
    5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    6. <link href="plugin.css" rel="stylesheet" type="text/css" />
    7. </head>
    8. <body>
    9. <div id="everything">
    10. <div style="FONT-FAMILY: Garamond, Times, Serif; TEXT-ALIGN: center; PADDING-TOP: 20px;">
    11. <fieldset id="colorspy"><legend>DHTML Color Picker</legend>
    12. <div id="mini" onmousedown="Picker.core('mini',event)">
    13. <div class="north"><span id="mHEX">FFFFFF</span><div onmousedown="\$S('mini').display='none';">X</div></div>
    14. <div class="south" id="mSpec" style="HEIGHT: 128px; WIDTH: 128px;" onmousedown="Picker.core('mCur',event)">
    15. <div id="mCur" style="TOP: 86px; LEFT: 68px;"></div>
    16. <img src="http://www.colorjack.com/software/media/circle.png" onmousedown="return false;" ondrag="return false;" onselectstart="return false;">
    17. <img src="http://www.colorjack.com/software/media/resize.gif" id="mSize" onmousedown="Picker.core('mSize',event); return false;" ondrag="return false;" onselectstart="return false;">
    18. </div>
    19. </div>
    20. <div id="plugID" style="HEIGHT: 104px; WIDTH: 550px; MARGIN: 12px 0 0 170px; PADDING-TOP: 60px; COLOR: #000; BORDER: 1px solid #333; TEXT-ALIGN: center; FONT-SiZE: 25px; BACKGROUND: #333;"><a href="http://www.nofunc.com/DHTML_Color_Picker/">DHTML Color Picker</a><br>Free to use on your own projects!</div>
    21. </fieldset>
    22. </div>
    23. </div>
    24. <script type="text/javascript">
    25. /* DHTML Color Sphere : v1.0.2 : 2008/04/17 */
    26. /* http://www.colorjack.com/software/dhtml+color+sphere.html */
    27. function $(v,o) { return((typeof(o)=='object'?o:document).getElementById(v)); }
    28. function $S(o) { o=$(o); if(o) return(o.style); }
    29. function abPos(o) { var o=(typeof(o)=='object'?o:$(o)), z={X:0,Y:0}; while(o!=null) { z.X+=o.offsetLeft; z.Y+=o.offsetTop; o=o.offsetParent; }; return(z); }
    30. function agent(v) { return(Math.max(navigator.userAgent.toLowerCase().indexOf(v),0)); }
    31. function isset(v) { return((typeof(v)=='undefined' || v.length==0)?false:true); }
    32. function toggle(i,t,xy) { var v=$S(i); v.display=t?t:(v.display=='none'?'block':'none'); if(xy) { v.left=xy[0]; v.top=xy[1]; } }
    33. function XY(e,v) { var o=agent('msie')?{'X':e.clientX+document.body.scrollLeft,'Y':e.clientY+document.body.scrollTop}:{'X':e.pageX,'Y':e.pageY}; return(v?o[v]:o); }
    34. function zero(n) { return(!isNaN(n=parseFloat(n))?n:0); }
    35. function zindex(d) { d.style.zIndex=zINDEX++; }
    36. /* COLOR PICKER */
    37. Picker={};
    38. Picker.stop=1;
    39. Picker.core=function(o,e,xy,z,fu) {
    40. function point(a,b,e) { eZ=XY(e); commit([eZ.X+a,eZ.Y+b]); }
    41. function M(v,a,z) { return(Math.max(!isNaN(z)?z:0,!isNaN(a)?Math.min(a,v):v)); }
    42. function commit(v) { if(fu) fu(v);
    43. if(o=='mCur') { var W=parseInt($S('mSpec').width), W2=W/2, W3=W2/2;
    44. var x=v[0]-W2-3, y=W-v[1]-W2+21, SV=Math.sqrt(Math.pow(x,2)+Math.pow(y,2)), hue=Math.atan2(x,y)/(Math.PI*2);
    45. hsv={'H':hue>0?(hue*360):((hue*360)+360), 'S':SV<W3?(SV/W3)*100:100, 'V':SV>=W3?Math.max(0,1-((SV-W3)/(W2-W3)))*100:100};
    46. $('mHEX').innerHTML=color.HSV_HEX(hsv); $S('plugID').background='#'+$('mHEX').innerHTML; color.cords(W);
    47. }
    48. else if(o=='mSize') { var b=Math.max(Math.max(v[0],v[1])+oH,75); color.cords(b);
    49. $S('mini').height=(b+28)+'px'; $S('mini').width=(b+20)+'px';
    50. $S('mSpec').height=b+'px'; $S('mSpec').width=b+'px';
    51. }
    52. else {
    53. if(xy) v=[M(v[0],xy[0],xy[2]), M(v[1],xy[1],xy[3])]; // XY LIMIT
    54. if(!xy || xy[0]) d.left=v[0]+'px'; if(!xy || xy[1]) d.top=v[1]+'px';
    55. }
    56. };
    57. if(Picker.stop) { Picker.stop=''; var d=$S(o), eZ=XY(e); if(!z) zindex($(o));
    58. if(o=='mCur') { var ab=abPos($(o).parentNode); point(-(ab.X-5),-(ab.Y-28),e); }
    59. if(o=='mSize') { var oH=parseInt($S('mSpec').height), oX=-XY(e).X, oY=-XY(e).Y; }
    60. else { var oX=zero(d.left)-eZ.X, oY=zero(d.top)-eZ.Y; }
    61. document.onmousemove=function(e){ if(!Picker.stop) point(oX,oY,e); };
    62. document.onmouseup=function(){ Picker.stop=1; document.onmousemove=''; document.onmouseup=''; };
    63. }
    64. };
    65. Picker.hsv={H:0, S:0, V:100};
    66. zINDEX=2;
    67. /* COLOR LIBRARY */
    68. color={};
    69. color.cords=function(W) {
    70. var W2=W/2, rad=(hsv.H/360)*(Math.PI*2), hyp=(hsv.S+(100-hsv.V))/100*(W2/2);
    71. $S('mCur').left=Math.round(Math.abs(Math.round(Math.sin(rad)*hyp)+W2+3))+'px';
    72. $S('mCur').top=Math.round(Math.abs(Math.round(Math.cos(rad)*hyp)-W2-21))+'px';
    73. };
    74. color.HEX=function(o) { o=Math.round(Math.min(Math.max(0,o),255));
    75. return("0123456789ABCDEF".charAt((o-o%16)/16)+"0123456789ABCDEF".charAt(o%16));
    76. };
    77. color.RGB_HEX=function(o) { var fu=color.HEX; return(fu(o.R)+fu(o.G)+fu(o.B)); };
    78. color.HSV_RGB=function(o) {
    79. var R, G, A, B, C, S=o.S/100, V=o.V/100, H=o.H/360;
    80. if(S>0) { if(H>=1) H=0;
    81. H=6*H; F=H-Math.floor(H);
    82. A=Math.round(255*V*(1-S));
    83. B=Math.round(255*V*(1-(S*F)));
    84. C=Math.round(255*V*(1-(S*(1-F))));
    85. V=Math.round(255*V);
    86. switch(Math.floor(H)) {
    87. case 0: R=V; G=C; B=A; break;
    88. case 1: R=B; G=V; B=A; break;
    89. case 2: R=A; G=V; B=C; break;
    90. case 3: R=A; G=B; B=V; break;
    91. case 4: R=C; G=A; B=V; break;
    92. case 5: R=V; G=A; B=B; break;
    93. }
    94. return({'R':R?R:0, 'G':G?G:0, 'B':B?B:0, 'A':1});
    95. }
    96. else return({'R':(V=Math.round(V*255)), 'G':V, 'B':V, 'A':1});
    97. };
    98. color.HSV_HEX=function(o) { return(color.RGB_HEX(color.HSV_RGB(o))); };
    99. /* LOAD */
    100. $S('mini').left=($('colorspy').offsetLeft+35)+'px';
    101. $S('mini').top=($('colorspy').offsetTop+36)+'px';
    102. </script>
    103. </body>
    104. </html>
    Alles anzeigen
    Bilder
    • jsie_colorsphere.jpg

      127,59 kB, 872×750, 287 mal angesehen
    • fehler_ie_vs.jpg

      68,83 kB, 902×442, 324 mal angesehen
    • colorsphere_firefox_ok.jpg

      14,36 kB, 778×199, 261 mal angesehen
    Dateien
  • Willkommen!

    Sorry, tausende Zeilen an Fremdcode gehen wir hier normalerweise nicht durch.
    Ich bin schon bei den ersten zwei Zeilen hängen geblieben

    Besuch doch mal die Webseite des Scripts: nofunc.org/DHTML_Color_Sphere/
    Funktioniert es auf der Webseite mit dem Internet Explorer?
    Wenn ja, hast du einen Fehler bei der Implementierung gemacht.
    Wenn nein, dann kannst du den Autor ja mal direkt anschreiben.

    Ansonsten würde ich dir einfach empfehlen einen anderen Color Picker zu verwenden.
    Zum Beispiel hier eine JQUERY Version: eyecon.ro/colorpicker/