mirror of
https://github.com/oopuuu/zTC1.git
synced 2025-12-12 13:08:13 +08:00
向前滑时不向后滑
This commit is contained in:
@@ -322,17 +322,19 @@
|
||||
re = re.replace(/'/g, '"');
|
||||
var power = JSON.parse(re);
|
||||
power_idx = power.idx + 1;
|
||||
|
||||
var power_line = document.getElementById("ct-chart-par");
|
||||
var x = power_line.scrollWidth - power_line.offsetWidth - power_line.scrollLeft;
|
||||
|
||||
power.powers.forEach(element => {
|
||||
data.series[0].push(element/10);
|
||||
});
|
||||
chart_wth += power.powers.length;
|
||||
$("#ct-chart").width(chart_wth * 10);
|
||||
t.update(data);
|
||||
var power_line = document.getElementById("ct-chart-par");
|
||||
if (power.powers.length != 0 && power_line.scrollWidth - power_line.offsetWidth - power_line.scrollLeft < 10) {
|
||||
if (power.powers.length != 0 && x < 100) {
|
||||
power_line.scrollTo(power_line.scrollWidth, 0); //滑动到最后
|
||||
}
|
||||
power_line.scrollTo(power_line.scrollWidth, 0); //滑动到最后
|
||||
window.setTimeout(GetPowerRecord, 3000);
|
||||
},
|
||||
error: AjaxErr
|
||||
|
||||
Reference in New Issue
Block a user