为什么 jQuery 滑动方向在显示/隐藏时不起作用?

发布于 2025-01-12 06:39:14 字数 523 浏览 3 评论 0原文

不明白为什么在这种情况下我不能应用 'slide', {direction: 'left'}, 1000 来隐藏/显示。如果滑块没有 'slide', {direction: 'left'}, 1000 则有效。

$(document).ready(function(){
    $('.custom-header__background>li:gt(0)').hide(); 
     setInterval(function() {
        $('.custom-header__background > li:first')
          .hide('slide', {direction: 'left'}, 1000)
          .next()
          .show('slide', {direction: 'left'}, 1000)
          .end()
          .appendTo('.custom-header__background');
      }, 2000);
   }); 

Can't figure it out why I cant apply 'slide', {direction: 'left'}, 1000 to hide/show in this case. If the slider is without 'slide', {direction: 'left'}, 1000 it works.

$(document).ready(function(){
    $('.custom-header__background>li:gt(0)').hide(); 
     setInterval(function() {
        $('.custom-header__background > li:first')
          .hide('slide', {direction: 'left'}, 1000)
          .next()
          .show('slide', {direction: 'left'}, 1000)
          .end()
          .appendTo('.custom-header__background');
      }, 2000);
   }); 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文