Project1

标题: MV是否有这种网游风格的文字滚动脚本?求助达人 [打印本页]

作者: jiangjie81    时间: 2016-7-12 09:36
标题: MV是否有这种网游风格的文字滚动脚本?求助达人
MV是否有这种网游风格的文字滚动脚本?求助达人

如下图所示,还盼高人不吝赐教啊,在此跪谢了

232934jzucgc8n7t4447i4.png (496.77 KB, 下载次数: 30)

232934jzucgc8n7t4447i4.png

作者: [email protected]    时间: 2016-7-14 15:26
本帖最后由 [email protected] 于 2016-7-14 15:28 编辑

应该可以吧!
JAVASCRIPT 代码复制
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>test</title>
  6. <style type="text/css">
  7. #textHeight{line-height:25px; height:25px; overflow:hidden; width:150px; font-size:12px; border:solid 1px #666;}
  8. </style>
  9. <script language="javascript" type="text/javascript">
  10. function ScrollText(content){
  11. this.Delay=10;
  12. this.Amount=1;
  13. this.Direction="up";
  14. this.Timeout=1000;
  15. this.ScrollContent=this.gid(content);
  16. this.ScrollContent.innerHTML += this.ScrollContent.innerHTML;
  17. this.ScrollContent.onmouseover = this.GetFunction(this,"Stop");
  18. this.ScrollContent.onmouseout = this.GetFunction(this,"Start");
  19. }
  20.  
  21. ScrollText.prototype.gid=function(element){
  22. return document.getElementById(element);
  23. }
  24. ScrollText.prototype.Stop=function(){
  25. clearTimeout(this.AutoScrollTimer);
  26. clearTimeout(this.ScrollTimer);
  27. }
  28. ScrollText.prototype.Start=function(){
  29. clearTimeout(this.AutoScrollTimer);
  30. this.AutoScrollTimer=setTimeout(this.GetFunction(this,"AutoScroll"),this.Timeout);
  31. }
  32.  
  33. ScrollText.prototype.AutoScroll=function(){
  34. if(this.Direction=="up"){
  35. if(parseInt(this.ScrollContent.scrollTop)>=parseInt(this.ScrollContent.scrollHeight)/2){
  36. this.ScrollContent.scrollTop=0;
  37. clearTimeout(this.AutoScrollTimer);
  38. this.AutoScrollTimer = setTimeout(this.GetFunction(this,"AutoScroll"), this.Timeout);
  39. return;
  40. }
  41. this.ScrollContent.scrollTop += this.Amount;
  42. }else
  43. {
  44. if(parseInt(this.ScrollContent.scrollTop) <= 0)
  45. {
  46. this.ScrollContent.scrollTop = parseInt(this.ScrollContent.scrollHeight) / 2;
  47. }
  48. this.ScrollContent.scrollTop -= this.Amount;
  49. }
  50. if(parseInt(this.ScrollContent.scrollTop) % this.LineHeight != 0)
  51. {
  52. this.ScrollTimer = setTimeout(this.GetFunction(this,"AutoScroll"), this.Delay);
  53. }
  54. else
  55. {
  56. this.AutoScrollTimer = setTimeout(this.GetFunction(this,"AutoScroll"), this.Timeout);
  57. }
  58. }
  59.  
  60. ScrollText.prototype.GetFunction=function(variable,method){
  61. return function()
  62. {
  63. variable[method]();
  64. }
  65. }
  66. </script>
  67. </head>
  68.  
  69. <body>
  70. <div id="textHeight" title="xx">
  71. <a href="#">12345</a> <span> | </span>
  72. <a href="#">23456</a> <span> | </span>
  73. <a href="#">34567</a> <span> | </span>
  74. <a href="#">45678</a> <span> | </span>
  75. <a href="#">56789</a> <span> | </span>
  76. </div>
  77. <script>
  78. var scrollup = new ScrollText("textHeight");
  79. scrollup.Start();
  80. </script>
  81. </body>
  82. </html>

这个拿去改改应该可以吧!我没有用Mv不清楚!
作者: tseyik    时间: 2016-7-14 18:06
本帖最后由 tseyik 于 2016-7-30 13:26 编辑

有幾個巴


作者: jiangjie81    时间: 2016-7-30 12:58
官方脚本里的TinyGetInfoWnd 就可以实现,虽然只是针对道具类。但是已经不错了。




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1