index.js
资源名称:1.rar [点击查看]
上传用户:ziqing_518
上传日期:2022-08-09
资源大小:446k
文件大小:3k
源码类别:

多媒体编程

开发平台:

ASP/ASPX

  1. //***********默认设置定义.*********************
  2. tPopWait=20;//停留tWait豪秒后显示提示。
  3. tPopShow=5000;//显示tShow豪秒后关闭提示
  4. showPopStep=20;
  5. popOpacity=99;
  6. //***************内部变量定义*****************
  7. sPop=null;
  8. curShow=null;
  9. tFadeOut=null;
  10. tFadeIn=null;
  11. tFadeWaiting=null;
  12. document.write("<style type='text/css'id='defaultPopStyle'>");
  13. document.write(".cPopText {  background-color: #F8F8F5;color:#000000; border: 1px #000000 solid;font-color: font-size: 12px; padding-right: 4px; padding-left: 4px; height: 20px; padding-top: 2px; padding-bottom: 2px; filter: Alpha(Opacity=0)}");
  14. document.write("</style>");
  15. document.write("<div id='dypopLayer' style='position:absolute;z-index:1000;' class='cPopText'></div>");
  16. function showPopupText(){
  17. var o=event.srcElement;
  18. MouseX=event.x;
  19. MouseY=event.y;
  20. if(o.alt!=null && o.alt!=""){o.dypop=o.alt;o.alt=""};
  21.         if(o.title!=null && o.title!=""){o.dypop=o.title;o.title=""};
  22. if(o.dypop!=sPop) {
  23. sPop=o.dypop;
  24. clearTimeout(curShow);
  25. clearTimeout(tFadeOut);
  26. clearTimeout(tFadeIn);
  27. clearTimeout(tFadeWaiting);
  28. if(sPop==null || sPop=="") {
  29. dypopLayer.innerHTML="";
  30. dypopLayer.style.filter="Alpha()";
  31. dypopLayer.filters.Alpha.opacity=0;
  32. }
  33. else {
  34. if(o.dyclass!=null) popStyle=o.dyclass 
  35. else popStyle="cPopText";
  36. curShow=setTimeout("showIt()",tPopWait);
  37. }
  38. }
  39. }
  40. function showIt(){
  41. dypopLayer.className=popStyle;
  42. dypopLayer.innerHTML=sPop;
  43. popWidth=dypopLayer.clientWidth;
  44. popHeight=dypopLayer.clientHeight;
  45. if(MouseX+12+popWidth>document.body.clientWidth) popLeftAdjust=-popWidth-24
  46. else popLeftAdjust=0;
  47. if(MouseY+12+popHeight>document.body.clientHeight) popTopAdjust=-popHeight-24
  48. else popTopAdjust=0;
  49. dypopLayer.style.left=MouseX+12+document.body.scrollLeft+popLeftAdjust;
  50. dypopLayer.style.top=MouseY+12+document.body.scrollTop+popTopAdjust;
  51. dypopLayer.style.filter="Alpha(Opacity=0)";
  52. fadeOut();
  53. }
  54. function fadeOut(){
  55. if(dypopLayer.filters.Alpha.opacity<popOpacity) {
  56. dypopLayer.filters.Alpha.opacity+=showPopStep;
  57. tFadeOut=setTimeout("fadeOut()",1);
  58. }
  59. else {
  60. dypopLayer.filters.Alpha.opacity=popOpacity;
  61. tFadeWaiting=setTimeout("fadeIn()",tPopShow);
  62. }
  63. }
  64. function fadeIn(){
  65. if(dypopLayer.filters.Alpha.opacity>0) {
  66. dypopLayer.filters.Alpha.opacity-=1;
  67. tFadeIn=setTimeout("fadeIn()",1);
  68. }
  69. }
  70. document.onmouseover=showPopupText;
  71. function MM_openBrWindow(theURL,winName,features) { //v2.0
  72.   window.open(theURL,winName,features);
  73. }