search

Home  >  Q&A  >  body text

javascript - In the bootstrap carousel plug-in, how to trigger events when the carousel reaches the first and last items?

In the bootstrap carousel plug-in, how to trigger events when the carousel reaches the first and last one

迷茫迷茫2794 days ago781

reply all(1)I'll reply

  • 漂亮男人

    漂亮男人2017-06-12 09:30:48

    Resolved
    Quote http://www.cnblogs.com/zuoyif...

      $('#myCarousel').on('slide.bs.carousel', function (event) {
            var $hoder = $('#myCarousel').find('.item'),
                $items = $(event.relatedTarget);
            //getIndex就是轮播到当前位置的索引
            var getIndex= $hoder.index($items);
        });
                    
                
                
            
            

    reply
    0
  • Cancelreply