Deprecated: imwpcache\f884414bce24ee67f\f73723ec7b1919fa5::__construct(): Implicitly marking parameter $YECBGYFECGEAFWHA as nullable is deprecated, the explicit nullable type must be used instead in /www/wwwroot/www.chuangxiangniao.com/wp-content/plugins/imwpcache-dist/build/f884414bce24ee67ff73723ec7b1919fa5.php on line 2

Deprecated: imwpcache\f884414bce24ee67f\f73723ec7b1919fa5::__construct(): Implicitly marking parameter $BBWFDDBHHYHDXXAB as nullable is deprecated, the explicit nullable type must be used instead in /www/wwwroot/www.chuangxiangniao.com/wp-content/plugins/imwpcache-dist/build/f884414bce24ee67ff73723ec7b1919fa5.php on line 2
轮播图最后一页切换回第一页时出现闪动,如何解决?_创想鸟

轮播图最后一页切换回第一页时出现闪动,如何解决?

轮播图最后一页切换回第一页时出现闪动,如何解决?

轮播循环切换闪动原因及解决

轮播图最后一页切换回第一页时出现闪动,原因如下:

当使用 translate3d 方式切换时,CSS 样式没有及时更新。解决这个问题的方法是修改 changeCur 方法:

changeCur(add) {  this.con.style.transitionDuration = '.3s';  let cur = parseInt(this.out.style.getPropertyValue('--cur'));  if (add) {    if (cur === this.num) {      this.con.style.transitionDuration = '0s';      this.setCur(0);      this.con.offsetWidth;      this.con.style.transitionDuration = '.3s';      this.setCur(1);    } else {      this.setCur(cur + 1);    }  } else {    if (cur === 1) {      this.con.style.transitionDuration = '0s';      this.setCur(this.num + 1);      this.con.offsetWidth;      this.con.style.transitionDuration = '.3s';      this.setCur(this.num);    } else {      this.setCur(cur - 1);    }  }}

以上就是轮播图最后一页切换回第一页时出现闪动,如何解决?的详细内容,更多请关注创想鸟其它相关文章!

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 chuangxiangniao@163.com 举报,一经查实,本站将立刻删除。
发布者:程序猿,转转请注明出处:https://www.chuangxiangniao.com/p/1559488.html

赞 (0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
在浏览器调试时如何保持元素的点击事件?
上一篇 2025年12月22日 04:48:29
如何让 CSS 容器始终位于底部?
下一篇 2025年12月22日 04:48:43

相关推荐

发表回复

登录后才能评论
关注微信