漂亮的title提示信息

  1. <HTML> 
  2. <HEAD> 
  3. <title>一种很酷的文字提示效果演示</title> 
  4. <style> 
  5. .tableBorder7{width:800;solid; background-color: #000000;} 
  6. TD{font-family: 宋体;font-size: 12px;line-height : 15px ;} 
  7. th{background-color: #f7f7f7;color: #000000;font-size: 12px;font-weight:bold;} 
  8. th.th1{background-color: #333333;} 
  9. td.TableBody7{background-color: #B1EA45;} 
  10. </style> 
  11. <script language="JavaScript"> 
  12. //more javascript from http://www.51it.org 
  13. <!-- 
  14. var pltsPop=null; 
  15. var pltsoffsetX = 10;   // 弹出窗口位于鼠标左侧或者右侧的距离;3-12 合适 
  16. var pltsoffsetY = 15;  // 弹出窗口位于鼠标下方的距离;3-12 合适 
  17. var pltsPopbg="#FFFFEE"; //背景色 
  18. var pltsPopfg="#111111"; //前景色 
  19. var pltsTitle=""; 
  20. document.write('<div id=pltsTipLayer style="display: none;position: absolute; z-index:10001"></div>'); 
  21.  
  22. function pltsinits() 
  23. { 
  24.     document.onmouseover   = plts; 
  25.     document.onmousemove = moveToMouseLoc; 
  26. } 
  27.  
  28. function plts() 
  29. {  var o=event.srcElement; 
  30.     if(o.alt!=null && o.alt!=""){oo.dypop=o.alt;o.alt=""}; 
  31.     if(o.title!=null && o.title!=""){oo.dypop=o.title;o.title=""}; 
  32.     pltsPop=o.dypop; 
  33.     if(pltsPop!=null&&pltsPop!=""&&typeof(pltsPop)!="undefined") 
  34.     { 
  35.        pltsTipLayer.style.left=-1000; 
  36.        pltsTipLayer.style.display=''; 
  37.        var Msg=pltsPop.replace(/\n/g,"<br>"); 
  38.        MsgMsg=Msg.replace(/\0x13/g,"<br>"); 
  39.        var re=/\{(.[^\{]*)\}/ig; 
  40.        if(!re.test(Msg))pltsTitle="<font color=#ffffff>简介</font>"; 
  41.        else{ 
  42.          re=/\{(.[^\{]*)\}(.*)/ig; 
  43.            pltsTitle=Msg.replace(re,"$1")+" "; 
  44.          re=/\{(.[^\{]*)\}/ig; 
  45.          MsgMsg=Msg.replace(re,""); 
  46.          MsgMsg=Msg.replace("<br>","");} 
  47.          //var attr=(document.location.toString().toLowerCase().indexOf("list.asp")>0?"nowrap":""); 
  48.               var content = 
  49.              '<table style="FILTER:alpha(opacity=90) shadow(color=#bbbbbb,direction=135);" id=toolTipTalbe border=0><tr><td width="100%"><table class=tableBorder7 cellspacing="1" cellpadding="0" style="width:100%">'+ 
  50.              '<tr id=pltsPoptop ><th height=18 valign=bottom class=th1 ><b><p id=topleft align=left><font color=#ffffff>↖</font>'+pltsTitle+'</p><p id=topright align=right style="display:none">'+pltsTitle+'<font color=#ffffff>↗</font></b></th></tr>'+ 
  51.              '<tr><td "+attr+" class=tablebody7 style="padding-left:14px;padding-right:14px;padding-top: 6px;padding-bottom:6px;line-height:135%">'+Msg+'</td></tr>'+ 
  52.              '<tr id=pltsPopbot style="display:none"><th height=18 valign=bottom class=th1><b><p id=botleft align=left><font color=#ffffff>↙</font>'+pltsTitle+'</p><p id=botright align=right style="display:none">'+pltsTitle+'<font color=#ffffff>↘</font></b></th></tr>'+ 
  53.              '</table></td></tr></table>'; 
  54.               pltsTipLayer.innerHTML=content; 
  55.               toolTipTalbe.style.width=Math.min(pltsTipLayer.clientWidth,document.body.clientWidth/2.2); 
  56.               moveToMouseLoc(); 
  57.               return true; 
  58.        } 
  59.     else 
  60.     { 
  61.            pltsTipLayer.innerHTML=''; 
  62.              pltsTipLayer.style.display='none'; 
  63.               return true; 
  64.     } 
  65. } 
  66.  
  67.  
  68. function moveToMouseLoc() 
  69. { 
  70.        if(pltsTipLayer.innerHTML=='')return true; 
  71.        var MouseX=event.x; 
  72.        var MouseY=event.y; 
  73.        //window.status=event.y; 
  74.        var popHeight=pltsTipLayer.clientHeight; 
  75.        var popWidth=pltsTipLayer.clientWidth; 
  76.        if(MouseY+pltsoffsetY+popHeight>document.body.clientHeight) 
  77.        { 
  78.                 popTopAdjust=-popHeight-pltsoffsetY*1.5; 
  79.                 pltsPoptop.style.display="none"; 
  80.                 pltsPopbot.style.display=""; 
  81.        } 
  82.         else 
  83.        { 
  84.                  popTopAdjust=0; 
  85.                 pltsPoptop.style.display=""; 
  86.                 pltsPopbot.style.display="none"; 
  87.        } 
  88.        if(MouseX+pltsoffsetX+popWidth>document.body.clientWidth) 
  89.        { 
  90.               popLeftAdjust=-popWidth-pltsoffsetX*2; 
  91.               topleft.style.display="none"; 
  92.               botleft.style.display="none"; 
  93.               topright.style.display=""; 
  94.               botright.style.display=""; 
  95.        } 
  96.        else 
  97.        { 
  98.               popLeftAdjust=0; 
  99.               topleft.style.display=""; 
  100.               botleft.style.display=""; 
  101.               topright.style.display="none"; 
  102.               botright.style.display="none"; 
  103.        } 
  104.        pltsTipLayer.style.left=MouseX+pltsoffsetX+document.body.scrollLeft+popLeftAdjust; 
  105.        pltsTipLayer.style.top=MouseY+pltsoffsetY+document.body.scrollTop+popTopAdjust; 
  106.          return true; 
  107. } 
  108. pltsinits(); 
  109. //--> 
  110. </script> 
  111. </HEAD> 
  112.  
  113. <BODY> 
  114. <div title="醉别西楼醒不记,春梦秋云,聚散真容易。<br>斜月半窗还少睡。画屏闲展吴山翠。<br>衣上酒痕诗里字,点点行行,总是凄凉意。<br>红烛自怜无好计,夜寒空替人垂泪。">蝶恋花</div> 
  115. </BODY> 
  116. </HTML> 

 

 

posted @ 2014-08-10 10:06  商商-77  阅读(220)  评论(0)    收藏  举报