`
umgsai
  • 浏览: 103155 次
  • 性别: Icon_minigender_1
  • 来自: 广州
文章分类
社区版块
存档分类
最新评论

漂亮的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. <scriptlanguage="JavaScript">
  12. //morejavascriptfromhttp://www.51it.org
  13. <!--
  14. varpltsPop=null;
  15. varpltsoffsetX=10;//弹出窗口位于鼠标左侧或者右侧的距离;3-12合适
  16. varpltsoffsetY=15;//弹出窗口位于鼠标下方的距离;3-12合适
  17. varpltsPopbg="#FFFFEE";//背景色
  18. varpltsPopfg="#111111";//前景色
  19. varpltsTitle="";
  20. document.write('<divid=pltsTipLayerstyle="display:none;position:absolute;z-index:10001"></div>');
  21. functionpltsinits()
  22. {
  23. document.onmouseover=plts;
  24. document.onmousemove=moveToMouseLoc;
  25. }
  26. functionplts()
  27. {varo=event.srcElement;
  28. if(o.alt!=null&&o.alt!=""){oo.dypop=o.alt;o.alt=""};
  29. if(o.title!=null&&o.title!=""){oo.dypop=o.title;o.title=""};
  30. pltsPop=o.dypop;
  31. if(pltsPop!=null&&pltsPop!=""&&typeof(pltsPop)!="undefined")
  32. {
  33. pltsTipLayer.style.left=-1000;
  34. pltsTipLayer.style.display='';
  35. varMsg=pltsPop.replace(/\n/g,"<br>");
  36. MsgMsg=Msg.replace(/\0x13/g,"<br>");
  37. varre=/\{(.[^\{]*)\}/ig;
  38. if(!re.test(Msg))pltsTitle="<fontcolor=#ffffff>简介</font>";
  39. else{
  40. re=/\{(.[^\{]*)\}(.*)/ig;
  41. pltsTitle=Msg.replace(re,"$1")+"";
  42. re=/\{(.[^\{]*)\}/ig;
  43. MsgMsg=Msg.replace(re,"");
  44. MsgMsg=Msg.replace("<br>","");}
  45. //varattr=(document.location.toString().toLowerCase().indexOf("list.asp")>0?"nowrap":"");
  46. varcontent=
  47. '<tablestyle="FILTER:alpha(opacity=90)shadow(color=#bbbbbb,direction=135);"id=toolTipTalbeborder=0><tr><tdwidth="100%"><tableclass=tableBorder7cellspacing="1"cellpadding="0"style="width:100%">'+
  48. '<trid=pltsPoptop><thheight=18valign=bottomclass=th1><b><pid=topleftalign=left><fontcolor=#ffffff></font>'+pltsTitle+'</p><pid=toprightalign=rightstyle="display:none">'+pltsTitle+'<fontcolor=#ffffff></font></b></th></tr>'+
  49. '<tr><td"+attr+"class=tablebody7style="padding-left:14px;padding-right:14px;padding-top:6px;padding-bottom:6px;line-height:135%">'+Msg+'</td></tr>'+
  50. '<trid=pltsPopbotstyle="display:none"><thheight=18valign=bottomclass=th1><b><pid=botleftalign=left><fontcolor=#ffffff></font>'+pltsTitle+'</p><pid=botrightalign=rightstyle="display:none">'+pltsTitle+'<fontcolor=#ffffff></font></b></th></tr>'+
  51. '</table></td></tr></table>';
  52. pltsTipLayer.innerHTML=content;
  53. toolTipTalbe.style.width=Math.min(pltsTipLayer.clientWidth,document.body.clientWidth/2.2);
  54. moveToMouseLoc();
  55. returntrue;
  56. }
  57. else
  58. {
  59. pltsTipLayer.innerHTML='';
  60. pltsTipLayer.style.display='none';
  61. returntrue;
  62. }
  63. }
  64. functionmoveToMouseLoc()
  65. {
  66. if(pltsTipLayer.innerHTML=='')returntrue;
  67. varMouseX=event.x;
  68. varMouseY=event.y;
  69. //window.status=event.y;
  70. varpopHeight=pltsTipLayer.clientHeight;
  71. varpopWidth=pltsTipLayer.clientWidth;
  72. if(MouseY+pltsoffsetY+popHeight>document.body.clientHeight)
  73. {
  74. popTopAdjust=-popHeight-pltsoffsetY*1.5;
  75. pltsPoptop.style.display="none";
  76. pltsPopbot.style.display="";
  77. }
  78. else
  79. {
  80. popTopAdjust=0;
  81. pltsPoptop.style.display="";
  82. pltsPopbot.style.display="none";
  83. }
  84. if(MouseX+pltsoffsetX+popWidth>document.body.clientWidth)
  85. {
  86. popLeftAdjust=-popWidth-pltsoffsetX*2;
  87. topleft.style.display="none";
  88. botleft.style.display="none";
  89. topright.style.display="";
  90. botright.style.display="";
  91. }
  92. else
  93. {
  94. popLeftAdjust=0;
  95. topleft.style.display="";
  96. botleft.style.display="";
  97. topright.style.display="none";
  98. botright.style.display="none";
  99. }
  100. pltsTipLayer.style.left=MouseX+pltsoffsetX+document.body.scrollLeft+popLeftAdjust;
  101. pltsTipLayer.style.top=MouseY+pltsoffsetY+document.body.scrollTop+popTopAdjust;
  102. returntrue;
  103. }
  104. pltsinits();
  105. //-->
  106. </script>
  107. </HEAD>
  108. <BODY>
  109. <divtitle="醉别西楼醒不记,春梦秋云,聚散真容易。<br>斜月半窗还少睡。画屏闲展吴山翠。<br>衣上酒痕诗里字,点点行行,总是凄凉意。<br>红烛自怜无好计,夜寒空替人垂泪。">蝶恋花</div>
  110. </BODY>
  111. </HTML>

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics