mouse_on_title.js
Upload User: ahxunteng
Upload Date: 2022-05-16
Package Size: 1606k
Code Size: 2k
Development Platform:

VBScript

  1. var tPopWait=50;
  2. var tPopShow=6000;
  3. var showPopStep=20;
  4. var popOpacity=95;
  5. var tfontcolor="#000000";
  6. var tbgcolor="#ffffe1";
  7. var tbordercolor="#666666";
  8. var sPop=null,curShow=null,tFadeOut=null,tFadeIn=null,tFadeWaiting=null;
  9. document.write("<style type='text/css'id='defaultPopStyle'>");
  10. document.write(".cPopText {  background-color: " + tbgcolor + ";color:" + tfontcolor + "; border: 1px " + tbordercolor + " solid;font-color: font-size: 12px; padding-right: 4px; padding-left: 4px; height: 20px; padding-top: 2px; padding-bottom: 2px; filter: Alpha(Opacity=0)}");
  11. document.write("</style>");
  12. document.write("<div id='dypopLayer'style='position:absolute;z-index:1000;' class='cPopText'></div>");
  13. function showPopupText()
  14. {
  15.   var o=event.srcElement;
  16.   MouseX=event.x;
  17.   MouseY=event.y;
  18.   if(o.alt!=null && o.alt!=""){o.dypop=o.alt;o.alt=""};
  19.   //if(o.title!=null && o.title!=""){o.dypop=o.title;o.title=""};
  20.   if(o.dypop!=sPop)
  21.   {
  22.     sPop=o.dypop;
  23.     clearTimeout(curShow);
  24.     clearTimeout(tFadeOut);
  25.     clearTimeout(tFadeIn);
  26.     clearTimeout(tFadeWaiting);  
  27.     if(sPop==null || sPop=="")
  28.     {
  29.       dypopLayer.innerHTML="";
  30.       dypopLayer.style.filter="Alpha()";
  31.       dypopLayer.filters.Alpha.opacity=0;  
  32.     }
  33.     else
  34.     {
  35.       if(o.dyclass!=null) popStyle=o.dyclass 
  36.       else popStyle="cPopText";
  37.       curShow=setTimeout("showIt()",tPopWait);
  38.     }
  39.   }
  40. }
  41. function showIt()
  42. {
  43.   dypopLayer.className=popStyle;
  44.   dypopLayer.innerHTML=sPop;
  45.   popWidth=dypopLayer.clientWidth;
  46.   popHeight=dypopLayer.clientHeight;
  47.   if(MouseX+12+popWidth>document.body.clientWidth) popLeftAdjust=-popWidth-24
  48.     else popLeftAdjust=0;
  49.   if(MouseY+12+popHeight>document.body.clientHeight) popTopAdjust=-popHeight-24
  50.     else popTopAdjust=0;
  51.   dypopLayer.style.left=MouseX+12+document.body.scrollLeft+popLeftAdjust;
  52.   dypopLayer.style.top=MouseY+12+document.body.scrollTop+popTopAdjust;
  53.   dypopLayer.style.filter="Alpha(Opacity=0)";
  54.   fadeOut();
  55. }
  56. function fadeOut(){
  57.   if(dypopLayer.filters.Alpha.opacity<popOpacity)
  58.   {
  59.     dypopLayer.filters.Alpha.opacity+=showPopStep;
  60.     tFadeOut=setTimeout("fadeOut()",1);
  61.   }
  62.   else
  63.   {
  64.     dypopLayer.filters.Alpha.opacity=popOpacity;
  65.     tFadeWaiting=setTimeout("fadeIn()",tPopShow);
  66.   }
  67. }
  68. function fadeIn()
  69. {
  70.   if(dypopLayer.filters.Alpha.opacity>0)
  71.   {
  72.     dypopLayer.filters.Alpha.opacity-=1;
  73.     tFadeIn=setTimeout("fadeIn()",1);
  74.   }
  75. }
  76. document.onmouseover=showPopupText;