为了账号安全,请及时绑定邮箱和手机立即绑定

我复制了一遍函数,但总显示Cannot read property 'left' of underdifined是肿么回事

我复制了一遍函数,但总显示Cannot read property 'left' of underdifined是肿么回事

function ani (off) {
                if (off == 0) {
                    return;
                }
                animated = true;
                var rtime = 300;
                var rinteval = 10;
                var rspeed = off/(rtime/rinteval);
                var left = parseInt(rolist.style.left) + off;
                var gos = function (){
                    if ( (speed > 0 && parseInt(rolist.style.left) < left) || (rspeed < 0 && parseInt(rolist.style.left) > left)) {
                        rolist.style.left = parseInt(rolist.style.left) + rspeed + 'px';
                        setTimeout(go, rinteval);
                    }
                    else {
                        rolist.style.left = left + 'px';
                        if(left>-20){
                            rolist.style.left = -200 * len + 'px';
                        }
                        if(left<(-200 * len)) {
                            rolist.style.left = '-200px';
                        }
                        animated = false;
                    }
                }
                gos();
            }


正在回答

1 回答

看你的图片列表样式中有没有设置定位,有没有left属性

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

我复制了一遍函数,但总显示Cannot read property 'left' of underdifined是肿么回事

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信