shawl.qiuJavascript fade-out class FadedV1.0

shawl.qiu Javascript Faded V1.0

Explanation:
Well, about this, I have been learning about color science recently, so I have continued to Will do some color-related things.
For example, compile some color-related materials into a book, learn the psychological feelings related to color, color mixing skills, etc.

Contents:
1. Call
1.1 Call 1
1.2 Call 2
2. Class Faded

shawl.qiu
2007-06-20
http://blog.csdn.net/btbtd

Demo 1: http://files.myopera.com/btbtd/Javascript/class/faded/Faded_v1-0.htm
Demo 2: http://files.myopera.com/btbtd/Javascript/class/faded/Faded_v1-0_demo_1.htm

Download: http://files.myopera.com/btbtd/Javascript/ class/faded/Faded_v1-0.7z

Content:
1. Call
1.1 Call 1

  1. W3C //DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
  2. xmlns =“http://www.w3.org/1999/xhtml”>
  3. http-equiv=“Content-Type” content=“text/html; charset=utf-8″ />
  4. <table border=“0” align=“center” cellpadding=“4” cellspacing=” 4″>
  5. <tr align=“center” valign =“middle”>
  6. id=“FadeId1” style=“width:100px; height:100px; background-color:#cccccc; “>shawl.qiu

  7. id=“FadeId2” style=“width:100px; height:100px; background-color:#cccccc; “>shawl.qiu

  8. id= “FadeId3” style=“width:100px; height:100px; background-color:#cccccc; ” >shawl.qiu

  9. id=“FadeId4” style=“width:100px; height:100px; background-color:#cccccc; “>shawl.qiu

  10. id=“FadeId5” style=“width:100px; height:100px; background-color:#cccccc; “>shawl.qiu

  11. <tr align=“center” valign=“middle”>
  12. id=“FadeId6” style=” width:100px; height:100px; background-color:#cccccc; “>shawl.qiu

  13. id=“FadeId7” style=“width:100px; height:100px; background-color:#cccccc; “>shawl. qiu

  14. id=“FadeId8” style =“width:100px; height:100px; background-color:#cccccc; “>shawl.qiu

  15. id=“FadeId9” style=“width:100px; height:100px ; background-color:#cccccc; “>shawl.qiu

  16. id=“FadeId10” style=“width:100px; height:100px; background-color:#cccccc; “>shawl.qiu

  17. <tr align=“center” valign=“middle”>
  18. id=“FadeId11” style=“width:100px; height:100px; background-color:#cccccc; “>shawl.qiu

  19. id=“FadeId12” style =“width:100px; height:100px; background-color:#cccccc; “>shawl.qiu

  20. id=“FadeId13” style=“width:100px; height:100px; background- color:#cccccc; “>shawl.qiu

  21. id=“FadeId14” style=“width:100px; height:100px; background-color:#cccccc; “>shawl.qiu

  22. id=“FadeId15” style=“width:100px; height:100px; background-color:#cccccc; “>shawl.qiu

  23. <tr align=“center” valign=“middle”>
  24. id=“Fadepan>
  25.  arHex[1] = “0x”+arCell[2]+arCell[3];
  26.  arHex[2] = “0x”+arCell[4]+arCell[5];
  27.  arInt[0] = parseInt(arHex[0], 16);
  28.  arInt[1] = parseInt(arHex[1], 16);
  29.  arInt[2] = parseInt(arHex[2], 16);
  30. arIntFinal[0] = Math.abs(255-arInt[0]);
  31.  arIntFinal[1] = Math.abs(255-arInt[1]);
  32.  arIntFinal[2] = Math.abs(255-arInt[2]);
  33. arHexFinal[0] = fPadStr(arIntFinal[0].toString(16)).toUpperCase();
  34.  arHexFinal[1] = fPadStr(arIntFinal[1].toString(16)).toUpperCase();
  35.  arHexFinal[ 2] = fPadStr(arIntFinal[2].toString(16)) .toUpperCase();
  36. if(Debug)
  37. span >alert(“arCell: “+arCell);
  38.  alert(“arHex: “+arHex);
  39.   alert(“arInt: “+arInt);
  40. alert(“arIntFinal: “+arIntFinal);
  41. alert(“arHexFinal: “+arHexFinal);
  42.                                                                                       /span> arHexFinal.join(“”);
  43.  return “#”+arHexFinal.join(“”);
  44. }
  45. else
  46. {
  47. alert(“Unrecognized hexadecimal color code!”);
  48. }
  49. break;
  50. }
  51. return “000000”;
  52. function fStringToArray(sInput)
  53. {// shawl.qiu script
  54. var arCell = [];
  55. var iCount = 0;
  56. var iLen = sInput.length;
  57.  while(iCount<iLen)
  58.  {
  59.  arCell[iCount] = sInput.charAt(iCount);
  60. iCount++;
  61. }
  62. return arCell;
  63. } // end function fStringToArray
  64. function fPadStr(sSrc, sPad, nLen)
  65. {// shawl.qiu script
  66. if(!sSrc) return false;
  67. if(!sPad)sPad='0';
  68.  if(!nLen)nLen=2;
  69.  sSrc+='';
  70.  if(sSrc.length>=nLen)return sSrc;
  71.  sPad=new Array(nLen+1).join(sPad);
  72. var re= new RegExp('.*(.{'+(nLen)+'})$') ;
  73. return (sPad+sSrc).replace(re,'$1');
  74. } / / end function fPadStr
  75. } // end function fGetCompColor
  76. function fRgbToHex(sRgb, bNoSharp, bDebug)
  77. { // shawl.qiu script
  78. if(!sRgb||sRgb==“”)
  79.  {
  80.  alert(“RGB color code is incorrect!”);
  81.  return;
  82. }
  83. var Debug = bDebug;
  84. li>
  85. var sSharp = “”;
  86. if(!bNoSharp) sSharp = “#”;
  87. if(/rgb/(/i.test(sRgb))
  88. {
  89.  sRgb = sRgb.replace(/^[/s/ S]*?rgb/((.*?)/)[/s/S]*/gi, “$1”).replace(//s+/g, “”);
  90. }
  91. var RgbAr = sRgb.split(“,”);
  92. var sReturn = “”;
  93. sReturn =
  94. sSharp
  95. +(fPadStr((RgbAr[0]-0).toString(16)). toUpperCase())
  96. +(fPadStr((RgbAr[1]-0).toString(16)).toUpperCase())
  97. +(fPadStr((RgbAr[2] -0).toString(16)).toUpperCase())
  98. ;
  99. if(Debug)
  100. {
  101. alert(sReturn);
  102. }
  103. return sReturn;
  104. function fPadStr(sSrc, sPad, nLen)
  105. {// shawl .qiu script
  106. if(!sSrc)return false;
  107. if(!sPad)sPad='0';
  108. if(!nLen)nLen=2;
  109. sSrc+='';
  110.  if(sSrc.length> =nLen)return sSrc;
  111. sPad= new Array(nLen+1).join(sPad);
  112.  var re=new RegExp('.*(.{&# 39;+(nLen)+'})$');
  113.  return (sPad+sSrc ).replace(re,'$1');
  114. } // end function fPadStr
  115. } // end function fRgbToHex
  116. //————————————end private method
  117. } // shawl.qiu code
  118. //———————– ———-end class Faded()———————————//

n>“”)

  • {
  • alert(“RGB color code is incorrect!”);
  • return;
  • }
  • var Debug = bDebug;
  • var sSharp = “”;
  • if(!bNoSharp) sSharp = “#”;
  • if(/rgb/(/i.test(sRgb)) font>
  • {
  • sRgb = sRgb .replace(/^[/s/S]*?rgb/((.*?)/)[/s/S] */gi, “$1”).replace(//s+/g, “”);
  • }
  • var RgbAr = sRgb.split(“,”);
  • var sReturn = “”;
  •  sReturn = 
  •                                                                                                                            0]-0).toString(16)).toUpperCase())
  • +(fPadStr((RgbAr[1]-0).toString(16)).toUpperCase())
  • +(fPadStr((RgbAr[2]-0).toString(16)).toUpperCase())
  • ;
  • if(Debug)
  • {
  • alert(sReturn);
  • }
  • return sReturn;
  • function fPadStr(sSrc, sPad, nLen)
  • li>
  • {// shawl.qiu script
  • if(!sSrc)return false ;
  •  if(!sPad)sPad='0&#39 ;;
  •  if(!nLen)nLen=2;
  •  sSrc+='';
  •  if (sSrc.length>=nLen)return sSrc;
  • sPad=new Array(nLen+1).join(sPad);
  •  var re=new RegExp ('.*(.{'+(nLen)+'})$');
  • return (sPad+sSrc).replace(re,'$1');
  • } // end function fPadStr
  • } // end function fRgbToHex
  • //————————————end private method
  • } // shawl.qiu code
  • //———- ———————–end class Faded()———————– ———-//
  • This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/shawl-qiujavascript-fade-out-class-fadedv1-0/

    author: admin

    Previous article
    Next article

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    The latest and most comprehensive programming knowledge, all in 1024programmer.com

    © 2023 1024programmer - Encyclopedia of Programming Field
    Contact Us

    Contact us

    181-3619-1160

    Online consultation: QQ交谈

    E-mail: 34331943@QQ.com

    Working hours: Monday to Friday, 9:00-17:30, holidays off

    Follow wechat
    Scan wechat and follow us

    Scan wechat and follow us

    首页
    微信
    电话
    搜索