if (option5 && typeof option5 === "object") {
myChart5.setOption(option5, true);
var index = 0; //播放所在下标
var showTip = setInterval(function() {
console.log(1)
myChart5.dispatchAction({
type: 'showTip',
seriesIndex: 0,
dataIndex: index,
});
index++;
if (index >= 8) {
index = 0;
}
}, 4000);
myChart5.on('mousemove', function() {
console.log(1)
clearInterval(showTip)
showTip = null
});
// 鼠标离开,继续轮播
myChart5.on('mouseout', function() {
console.log(2)
if (!showTip) { // 如果 showTip 为 null,则重新启动轮播定时器
showTip = setInterval(function() {
console.log(1)
myChart5.dispatchAction({
type: 'showTip',
seriesIndex: 0,
dataIndex: index,
});
index++;
if (index >= 8) {
index = 0;
}
}, 4000);
}
});
}
html/echarts 播放提示框/鼠标移入暂停移出播放
最新推荐文章于 2024-06-16 14:48:26 发布