我有一个带有点的放大器轮播效果很好,但是当我轻扫以更改幻灯片时,幻灯片底部的点不会更改为新的活动幻灯片,直到幻灯片过渡动画完成,这使它看起来有一个大约一秒钟的延迟。
幻灯片定义为:
<amp-carousel type="slides" layout="responsive" width="16" height="9" data-amp-bind-slide="selectedSlide" on="slideChange:AMP.setState({selectedSlide: event.index})" autoplay loop>
< SLIDES HERE >
</amp-carousel>
然后点定义为:
<amp-state id="cmidotstate"><script type="application/json">
{ "cmidots.0": 'selected' }
</script></amp-state><amp-carousel id="cmidots" controls width="400" height="100"><div data-amp-bind-class="selectedSlide == 0 ? 'selected' : ''" on="tap:AMP.setState({selectedSlide: 0})" role="button" tabindex="0" class="selected"></div>
<div data-amp-bind-class="selectedSlide == 1 ? 'selected' : ''" on="tap:AMP.setState({selectedSlide: 1})" role="button" tabindex="1"></div>
<div data-amp-bind-class="selectedSlide == 2 ? 'selected' : ''" on="tap:AMP.setState({selectedSlide: 2})" role="button" tabindex="2"></div>
<div data-amp-bind-class="selectedSlide == 3 ? 'selected' : ''" on="tap:AMP.setState({selectedSlide: 3})" role="button" tabindex="3"></div>
<div data-amp-bind-class="selectedSlide == 4 ? 'selected' : ''" on="tap:AMP.setState({selectedSlide: 4})" role="button" tabindex="4"></div>
<div data-amp-bind-class="selectedSlide == 5 ? 'selected' : ''" on="tap:AMP.setState({selectedSlide: 5})" role="button" tabindex="5"></div>
<div data-amp-bind-class="selectedSlide == 6 ? 'selected' : ''" on="tap:AMP.setState({selectedSlide: 6})" role="button" tabindex="6"></div>
<div data-amp-bind-class="selectedSlide == 7 ? 'selected' : ''" on="tap:AMP.setState({selectedSlide: 7})" role="button" tabindex="7"></div>
<div data-amp-bind-class="selectedSlide == 8 ? 'selected' : ''" on="tap:AMP.setState({selectedSlide: 8})" role="button" tabindex="8"></div>
<div data-amp-bind-class="selectedSlide == 9 ? 'selected' : ''" on="tap:AMP.setState({selectedSlide: 9})" role="button" tabindex="9"></div>
</amp-carousel>
因此,按钮上的图像样式转换是匹配幻灯片的状态变为“选中”时
点上的样式有一个非常快的过渡,(0.01s)所以它不是动画速度阻碍了事情。
有没有办法在 swype 动作开始时触发样式更改,或者自动播放转换,而不是在结束时,所以幻灯片可以使用寻呼点更平滑地转换?