繁体   English   中英

如何在Twitter引导程序轮播中加载页面后隐藏左键?

[英]How to hide left button after page load in Twitter bootstrap carousel?

如何在Twitter引导程序轮播中加载页面后隐藏左键?

http://twitter.github.com/bootstrap/javascript.html#carousel

我的尝试(它在第一次行动后起作用,我需要所有时间):

$('#myCarousel').on('slid', '', function() {
    var $this = $(this);

    $this.children('.carousel-control').show();
    if($('.carousel-inner .item:first').hasClass('active')) {
      $this.children('.left.carousel-control').hide();
    } 
    else if($('.carousel-inner .item:last').hasClass('active')) {
      $this.children('.right.carousel-control').hide();
  }

});

只需在页面加载后隐藏左按钮。 因为它总是从第一张幻灯片开始。

$('#myCarousel > .left.carousel-control').hide();

或者,在页面加载后手动触发slid事件。

$('#myCarousel').on('slid', '', function () {
  ...
}).trigger('slid');

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM