| | |
| | | typeof this.options.callback === "function" && this.options.callback(config); |
| | | } |
| | | ProgressTime.prototype.setTime = function (e) { |
| | | var layerX = e && e.originalEvent.layerX; |
| | | var type = e && e.type; |
| | | var layerX= e && e.originalEvent.layerX; |
| | | var type=e && e.type;; |
| | | var tooltipTimestamp; |
| | | if (e&&e.timer){ |
| | | let timer = new Date(formatDate(new Date(e.timer), "YYYY/MM/DD HH:00:00")); |
| | | tooltipTimestamp=timer; |
| | | }else { |
| | | tooltipTimestamp = this.currentTimeTemp || this.currentTime.getTime(); // 返回当前的时间的时间戳 |
| | | } |
| | | var hoursWidth = $("." + this.id + "-center-t-ul li")[0].getBoundingClientRect().width / 24; // 计算每个小时所占的宽度 |
| | | var tooltipTimestamp = this.currentTimeTemp || this.currentTime.getTime(); // 返回当前的时间的时间戳 |
| | | var num = Math.floor((tooltipTimestamp - this.startTime.getTime()) / hourTimestamp); // 计算出多少小时 |
| | | num = layerX !== undefined ? Math.round(layerX / hoursWidth) : num; |
| | | var progressWidth = num * hoursWidth; // 计算出时间条的长度 |