跳到主要内容

onSlideShowSlideChanged

幻灯片放映演示期间幻灯片更改时调用的函数。提供当前幻灯片和上一张幻灯片的信息。

参数

名称数据类型描述
dataObject包含幻灯片信息的对象。
data.slideIndexnumber新幻灯片的索引。
data.previousSlideIndexnumber上一张幻灯片的索引(如果是第一张幻灯片则为 -1)。
window.Asc.plugin.attachEditorEvent('onSlideShowSlideChanged', (data) => {
data.previousSlideIndex === -1
? console.log(`This is the first slide that we are showing
since the presentation slide show started`)
: console.log(`Slide changed during presentation:
from slide index ${data.previousSlideIndex}
to slide index ${data.slideIndex}`);
});