返回列表 发帖
查看: 1642|回复: 2

[求助] 代码修改求助

12

主题

18

回帖

37

积分

初学乍练

贡献
0 点
金币
5 个
发表于 2021-9-12 18:38:53 | 显示全部楼层 |阅读模式
<style type="text/css">
.effshadow
{
  position: relative;
}
.effshadow:after
{
z-index: -1;
position: absolute;
content: "";
top: 15px;
left: 8px;
right: auto;
width: 50%;
height: 10%;
bottom: 80%;
max-width: 300px;
  background: #777;
  -webkit-box-shadow: 0 15px 10px #777;
  -moz-box-shadow: 0 15px 10px #777;
  box-shadow: 0 15px 10px #777;
  -webkit-transform: rotate(183deg);
  -moz-transform: rotate(183deg);
  -o-transform: rotate(183deg);
  -ms-transform: rotate(183deg);
  transform: rotate(183deg);
}  
.effbox h1{
        text-align:left;
        height:25px;
        line-height:25px;
        position:relative;
        top:0px;
        color:#009ad9;
        font:20px/1.5 Tahoma,'Microsoft Yahei','Simsun';
        float:left;
         margin:0px;
}
.effbox h3{
        text-align:center;
        position:relative;
        font:12px/1.5 Tahoma,'Microsoft Yahei','Simsun';
         margin:0px;
         height:30px;
}
.effbox {
        width:319px;
        height:37px;
        background:#FFF;
}
.shadowcon { width:100%; height:25px; margin:6px 5px 6px 10px; overflow:hidden;}
#rollBox{ height:25px; width:255px; overflow:hidden;list-style:none; margin:0; padding:0; position:relative; padding-left:5px; margin:50px auto; background:#FFf; cursor:pointer;}
.shadowcon li { list-style:none; line-height:25px; text-align:left;}
</style>
<div class="effbox">
<div class="effbox effshadow">
        <div class="shadowcon">
        <h3>
    <ul style="margin:5px 0 0 0;" id="rollBox">
    [loop]
    <li><a href="{url}" title="{title}"{target}>{title}({starttime})</a></li>
    [/loop]
    </ul>
    </h3></div></div></div>
   <script type="text/javascript">
var rollText={
        go:null,
        oParentUl:null,
        oUlH:null,
        liArr:null,
        childNode:null,
        timeout:null,
        run:function(id,delay){
                var oLiFirst=this.liArr[0];
                var liMarTop = oLiFirst.style.marginTop;
                var liTopNum=parseInt(liMarTop);
                var c = Math.abs(liTopNum);
                if(c< parseInt(this.oUlH)){
                        c++;
                        oLiFirst.style.marginTop ='-' + c + 'px';
                }else if(Math.abs(liTopNum)== parseInt(this.oUlH)){
                        clearInterval(this.go);
                        this.oParentUl.removeChild(oLiFirst);
                        this.oParentUl.appendChild(oLiFirst);
                        this.liArr[this.liArr.length-1].style.marginTop='0px';
                        this.timeout=setTimeout(function(obj,id,childtags,delay){return function(){obj.start(id,childtags,delay);};}(this,id,this.childNode,delay),delay);
                }

        },
        start:function(id,childtags,delay){

                this.childNode=childtags;
                this.oParentUl=document.getElementById(id);
                this.oUlH=this.oParentUl.currentStyle?this.oParentUl.currentStyle['height']:window.getComputedStyle(this.oParentUl,null)['height'];
                this.liArr=this.oParentUl.getElementsByTagName(childtags);
                for(var i=0;i<this.liArr.length;i++){
                        this.liArr.style.cssText +=';margin-top:0;height:'+this.oUlH+';line-height:'+this.oUlH+';display:block; width:100%;';

                }
                this.go =setInterval(
                         function(obj,id,delay){
                        return function(){obj.run(id,delay)}
                }(this,id,delay),100);
                this.oParentUl.onmouseover=function(obj){return function(){clearTimeout(obj.timeout);clearTimeout(obj.go);};}(this);
                this.oParentUl.onmouseout=function(obj){return function(){obj.go =setInterval(function(obj,id,delay){return function(){obj.run(id,delay)};}(obj,id,delay),100);};}(this);

        }
}
rollText.start('rollBox','li',3000);
function clone(){};
clone.prototype= rollText;
</script>



请问各位大神,这段代码如何修改才能让他最多能显示出5行数据,现在只能显示1行,应该调一下哪些数字大小?

小白一个,不懂代码,求大神帮忙修改一下吧










我知道答案 回答被采纳将会获得1 贡献 已有2人回答
回复

使用道具 举报

83

主题

2795

回帖

3564

积分

功行圆满

贡献
22 点
金币
351 个
发表于 2021-9-12 22:49:33 | 显示全部楼层
联系代码作者问问吧
回复 支持 反对

使用道具 举报

12

主题

18

回帖

37

积分

初学乍练

贡献
0 点
金币
5 个
 楼主| 发表于 2021-9-13 07:35:04 | 显示全部楼层
这是在网上找的,没有作者
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 关注公众号
  • 有偿服务微信
  • 有偿服务QQ

手机版|小黑屋|Discuz! 官方交流社区 ( 皖ICP备16010102号 |皖公网安备34010302002376号 )|网站地图|star

GMT+8, 2024-4-26 03:01 , Processed in 0.037205 second(s), 6 queries , Redis On.

Powered by Discuz! W1.0 Licensed

Cpoyright © 2001-2024 Discuz! Team.

关灯 在本版发帖
有偿服务QQ
有偿服务微信
返回顶部
快速回复 返回顶部 返回列表