U.Color.htm 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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></title>
  5. <script type="text/javascript"> document.domain = "1473.cn";</script>
  6. <script src="http://www.1473.cn/js/UC/UC23.js" type="text/javascript"></script>
  7. <script>
  8. U.Color = function (id) {
  9. var _C = new U.ColorT();
  10. _C.Sel(id);
  11. }
  12. U.ColorT = function () { }
  13. U.ColorT.prototype = {
  14. Sel: function (id) {
  15. if ($("#box")[0]) { document.body.removeChild(that.Box); }
  16. var _c = ["#ffffff", "#ffccc9", "#ffce93", "#fffc9e", "#ffffc7", "#9aff99", "#96fffb", "#cdffff", "#cbcefb", "#cfcfcf", "#fd6864", "#fe996b", "#fffe65", "#fcff2f", "#67fd9a", "#38fff8", "#68fdff", "#9698ed", "#c0c0c0", "#fe0000", "#f8a102", "#ffcc67", "#f8ff00", "#34ff34", "#68cbd0", "#34cdf9", "#6665cd", "#9b9b9b", "#cb0000", "#f56b00", "#ffcb2f", "#ffc702", "#32cb00", "#00d2cb", "#3166ff", "#6434fc", "#656565", "#9a0000", "#ce6301", "#cd9934", "#999903", "#009901", "#329a9d", "#3531ff", "#6200c9", "#343434", "#680100", "#963400", "#986536", "#646809", "#036400", "#34696d", "#00009b", "#303498", "#000000", "#330001", "#643403", "#663234", "#343300", "#013300", "#003532", "#010066", "#340096"];
  17. var Box = $$("div", { "id": "box" }, document.body);
  18. for (var i = 0; i < _c.length; i++) {
  19. var rgb = $$("div", { "onclick": [[this.Oel, ([this, id])]], "style": { "float": "left", "width": "15px", "height": "15px", "margin": "2px", "background": _c[i]} }, Box);
  20. if ((i + 1) % 9 == 0) {
  21. $$("br", { "style": { "clear": "both"} }, Box);
  22. }
  23. }
  24. this.Box = Box;
  25. },
  26. Oel: function (that, id) {
  27. $("#" + id.id)[0].style.background = this.style.background;
  28. document.body.removeChild(that.Box);
  29. }
  30. }
  31. </script>
  32. </head>
  33. <body>
  34. <div id="color" style="width: 80px; height: 30px;" onclick="U.Color(color);">
  35. 颜色</div>
  36. </body>
  37. </html>