设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 3119|回复: 5
打印 上一主题 下一主题

[已经解决] MV是否有这种网游风格的文字滚动脚本?求助达人

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
90 小时
注册时间
2006-5-22
帖子
68
跳转到指定楼层
1
发表于 2016-7-12 09:36:04 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
MV是否有这种网游风格的文字滚动脚本?求助达人

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

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

232934jzucgc8n7t4447i4.png

Lv1.梦旅人

梦石
0
星屑
50
在线时间
6 小时
注册时间
2016-7-14
帖子
12
2
发表于 2016-7-14 15:26:53 | 只看该作者
本帖最后由 [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不清楚!

点评

唉。可惜不会改javascript……期待达人。  发表于 2016-7-15 10:57
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
22032
在线时间
8575 小时
注册时间
2011-12-31
帖子
3362
3
发表于 2016-7-14 18:06:40 | 只看该作者
本帖最后由 tseyik 于 2016-7-30 13:26 编辑

有幾個巴

点评

抱歉,一不小心以为大神骂人了。。。仔细一看,原来是汉子顺序不影响阅读  发表于 2017-7-31 08:26
回复 支持 1 反对 1

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
90 小时
注册时间
2006-5-22
帖子
68
4
 楼主| 发表于 2016-7-30 12:58:31 | 只看该作者
官方脚本里的TinyGetInfoWnd 就可以实现,虽然只是针对道具类。但是已经不错了。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-16 15:46

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表