直接修改curShowTimeSeconds为什么不出效果,不明白
function update(){
var nextTime = getCurrentShowTimeSeconds()
if(nextTime!=curShowTimeSeconds)
curShowTimeSeconds = nextTime;
}curShowTimeSeconds
就会改变,然后下一次setInterval,render就会把时间改变,没啥错误的呀
function update(){
var nextTime = getCurrentShowTimeSeconds()
if(nextTime!=curShowTimeSeconds)
curShowTimeSeconds = nextTime;
}curShowTimeSeconds
就会改变,然后下一次setInterval,render就会把时间改变,没啥错误的呀
2016-02-29
function update(){
var nextShowTimeSeconds = getCurrentShowTimeSeconds()
var nextHours = parseInt(nextShowTimeSeconds / 3600)
var nextMinutes = parseInt( (nextShowTimeSeconds - nextHours * 3600)/60)
var nextSeconds = nextShowTimeSeconds % 60
var curHours = parseInt(curShowTimeSeconds / 3600)
var curMinutes = parseInt( (curShowTimeSeconds - curHours * 3600)/60)
var curSeconds = curShowTimeSeconds % 60
if(nextSeconds!=curSeconds){
curShowTimeSeconds = nextShowTimeSeconds;
}
}这是视频里讲的,像那些nextHours和curMinutes之类的有啥用,不如不用写,但像我问题里那样写就不行?
举报