alt.js
上传用户:yinyuehua
上传日期:2022-08-10
资源大小:17k
文件大小:2k
源码类别:

matlab例程

开发平台:

C#

  1. //***********默认设置定义.*********************
  2. tPopWait=50;//停留tWait毫秒后显示提示。
  3. tPopShow=30000;//显示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: #ffffff; border: 1px #000000 solid; 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='zzzpopLayer' 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.zzzpop=o.alt;o.alt=""};
  21.         if(o.title!=null && o.title!=""){o.zzzpop=o.title;o.title=""};
  22. if(o.zzzpop!=sPop) {
  23. sPop=o.zzzpop;
  24. clearTimeout(curShow);
  25. clearTimeout(tFadeOut);
  26. clearTimeout(tFadeIn);
  27. clearTimeout(tFadeWaiting);
  28. if(sPop==null || sPop=="") {
  29. zzzpopLayer.innerHTML="";
  30. zzzpopLayer.style.filter="Alpha()";
  31. zzzpopLayer.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. zzzpopLayer.className=popStyle;
  42. zzzpopLayer.innerHTML=sPop;
  43. popWidth=zzzpopLayer.clientWidth;
  44. popHeight=zzzpopLayer.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. zzzpopLayer.style.left=MouseX+12+document.body.scrollLeft+popLeftAdjust;
  50. zzzpopLayer.style.top=MouseY+12+document.body.scrollTop+popTopAdjust;
  51. zzzpopLayer.style.filter="Alpha(Opacity=0)";
  52. fadeOut();
  53. }
  54. function fadeOut(){
  55. if(zzzpopLayer.filters.Alpha.opacity<popOpacity) {
  56. zzzpopLayer.filters.Alpha.opacity+=showPopStep;
  57. tFadeOut=setTimeout("fadeOut()",1);
  58. }
  59. else {
  60. zzzpopLayer.filters.Alpha.opacity=popOpacity;
  61. tFadeWaiting=setTimeout("fadeIn()",tPopShow);
  62. }
  63. }
  64. function fadeIn(){
  65. if(zzzpopLayer.filters.Alpha.opacity>0) {
  66. zzzpopLayer.filters.Alpha.opacity-=1;
  67. tFadeIn=setTimeout("fadeIn()",1);
  68. }
  69. }
  70. document.onmouseover=showPopupText;