Bootstrap Nesting Carousel

Source: Internet
Author: User
Tags bootstrap carousel

The bootstrap carousel is implemented using the following levels of HTML code:

<div class= "Carousel Slide" id= "Carouselid" >
<div class= "Carousel-inner" >
<div class= "Item" >

<div class= "Carousel Slide" id= "carouselid1" >

<div class= "Carousel-inner" >

<div class= "item" > Layer Two container first frame content </div>
<div class= "Item" > First level Container two frame content </div>

......

</ d i v >         

<ol class= "Carousel-indicators" >
<li class= "active" data-slide-to= "0" data-target= "#CarouselId1" ></li>
<li data-slide-to= "1" data-target= "#CarouselId1" ></li>
<li data-slide-to= "2" data-target= "#CarouselId1" ></li>

......
</ol>

<a data-slide= "prev" class= "left Carousel-control" href= "#CarouselId1" ></a>
<a data-slide= "Next" class= "right Carousel-control" href= "#CarouselId1" ></a>

</div>

</div>
<div class= "Item" > first-level container first frame content </div>
<div class= "Item" > First level Container two frame content </div>

......

</div>

<ol class= "carousel-indicators" >
<li class= "active" data-slide-to= "0" data-target= "#CarouselId" ></LI>
<li data-slide-to=" 1 "data-target=" #CarouselId 1 "></LI>
<li data-slide-to= "2" data-target= "#CarouselId 1 "></LI>

......
</ol>

<a data-slide= "prev" class= "left Carousel-control" href= "#CarouselId" > </a>
<a data-slide= "Next" class= "right Carousel-control" href= "#CarouselId" > </a>
</div>

But if

<div class= "Item" ></div>

In order to nest the carousel, the existing code will be problematic, because in the event bindings in JavaScript, the Select element uses the Find method, when the first layer ID of carouselid is initialized when the class is item, the item nested in item is also selected , it also selects all child elements of class carousel-indicators, and requires manual modification to select the first level child element with children.

Bootstrap Nesting Carousel

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.