1

My code does not seem to work in jsfiddle. When I click the control left or control right nothing happens.I have added the external scripts (bootstrap and jQuery) and stylesheet (bootstrap) to the external resources. Do I need to reference the scripts also in the html editor ? fiddle

HTML

<div class="carousel fade" id="carousel">
    <ol class="carousel-indicators">
        <li class="active" data-slide-to="0" data-target="#carousel"></li>
        <li data-slide-to="1" data-target="#carousel"></li>
        <li data-slide-to="2" data-target="#carousel"></li>
    </ol>
    <div class="carousel-inner">
        <div class="active item">
                <div class="container">
                  <h3>Header 1</h3>
                    <h1 class="col-md-9">Some text </h1>
                </div><img class="main-image" src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBw0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ8NDQ0NFREWFhURExMYHSggGBolGxMVITEhJSkrLjo6Fx8zODMtNyg5LisBCgoKDQ0NDw8NDzcZFRkrKysrLS0rLS03KzcrKy0rKzctNy0tKysrNy0rLSsrNystKystLS0tKysrKysrKysrK//AABEIAKgBLAMBIgACEQEDEQH/xAAbAAEBAQEBAQEBAAAAAAAAAAADAgABBAUHBv/EABkQAQEBAQEBAAAAAAAAAAAAAAACARIRA//EABkBAQEBAQEBAAAAAAAAAAAAAAMCAQQABf/EABgRAQEBAQEAAAAAAAAAAAAAAAABAhES/9oADAMBAAIRAxEAPwD8edxsVmPsyOSu4qXMwk4uItdzFZjuSvJXBWtkrzGzCTKpB2uTJZhUySZXBa0mZJMqmSTCg3SMheQvJXkqHdDyVZBZheQ3iLsOQvINkKyG8RdiyFZBclXLeIuw8NyfluHuJ9ByHeD5CuHuMu3nyG4enhOw9xnt59hOy9OyjZZxU082yOpeqpFUpsJNPNsjqXpqR1KbC5081SPceipHsjsNNA3Ebh6xG4iwkoNxOybcRuIsJK+RmEnHJkkyyOy13MXONGEnFQVrZi8xswkyuDtcmTRLTJIlcDrTsyTJdmVzK4G6acJMuzJJlotaTMkmFzJZhUgdbRMLyCZCshfBXY8heQTIXkt4i6FkO8l5bl7ifQuVZBcl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WjrXiSIvQXpL0N6w+YK9DRK0VJdGUanV6jWFiKFRKFSaTI6DRqFSKbIaxGkoepNHxZLAYNDjj6OjyWRQWSRz6NB5BBpJHPo8GkE6WdXAahs1c6LNXmrgbDZpJDOmlUFosHgEY9HzXAbNBpDJJ1Tn0bFYPNVmtFYvNVmjzVetTYv1zdT6mqeekd2k7qd1zdeXI7uirXa0daxeYi9BekvQVrK6MRFanXd1KaaOaPVbqN1lXIjdHS6HSaXI6HS9HSKbI9Hq6RrCx8ONLII00uKPp6j0Rpp155006SOfUPGmnXnnTTRJQaj0TpJ0E6vNVKCx6J0k6886WNXKLUPJ4eeD/PVwGnog0Aks6SObR80maGdXmqDYXNVmiylzrUWFzXfR+ttPJ4vaTtD2nPWtmV+ubqfU7TFSNWjqm2hVTxM5Tei3Xaoe6k+Y2p3W3U7qSSNo6Vuo3WLkTQ9VWjrUlkTWirV1oq1FLmJoeqpG6w0fBjTS886adcMr6eoedNOvNOljSSh1HpnSzrzzS5pcoNR6Zok08uaWaXKLWXqnSxrzRp40kBqPTGnh5o08aSObUemdJOvPOkzVwFj0ZSs0GUvKUKw+avNDmqymjsL65tI6c2ms8q9d6H63ryuL2kbSdpFU82ZdqhVTlUOqYbOW3Ubrm0n1JZHd1zdc9TusVI1ajdbdRupXI1aOtdrR1qaWRNaOtVuo1NLImtHur0Vai0uY/n50s06z5+a+rqEmizTjElDqFmiTTMuUVi8os0zElDqGinoimYsrn3DxRppmLHNqGmlzTMuUNi5ok0zKHYvKVlszR2O9uduM17jvTm0zPPcRVjq2Zi5B1Q6pmT0sid1z1mT1bm6ndZmdbIjdRuszLSQe6itZk2kiN1G6zItJB1oqpmHqmzH/2Q==">
        </div>
        <div class="item">
                <div class="container">
                    <h3>Header 2</h3>
                    <h1 class="col-md-9">Some text </h1> <a class="q-arrow-link text-white various fancybox.iframe" href="https://www.youtube.com/embed/JeZQ7f58TsM?autoplay=1"> watch video 1 </a>
                </div><img class="main-image" src="data:image/jpeg;base64,/9j/4A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WNXKLUPJ4eeD/PVwGnog0Aks6SObR80maGdXmqDYXNVmiylzrUWFzXfR+ttPJ4vaTtD2nPWtmV+ubqfU7TFSNWjqm2hVTxM5Tei3Xaoe6k+Y2p3W3U7qSSNo6Vuo3WLkTQ9VWjrUlkTWirV1oq1FLmJoeqpG6w0fBjTS886adcMr6eoedNOvNOljSSh1HpnSzrzzS5pcoNR6Zok08uaWaXKLWXqnSxrzRp40kBqPTGnh5o08aSObUemdJOvPOkzVwFj0ZSs0GUvKUKw+avNDmqymjsL65tI6c2ms8q9d6H63ryuL2kbSdpFU82ZdqhVTlUOqYbOW3Ubrm0n1JZHd1zdc9TusVI1ajdbdRupXI1aOtdrR1qaWRNaOtVuo1NLImtHur0Vai0uY/n50s06z5+a+rqEmizTjElDqFmiTTMuUVi8os0zElDqGinoimYsrn3DxRppmLHNqGmlzTMuUNi5ok0zKHYvKVlszR2O9uduM17jvTm0zPPcRVjq2Zi5B1Q6pmT0sid1z1mT1bm6ndZmdbIjdRuszLSQe6itZk2kiN1G6zItJB1oqpmHqmzH/2Q==">
        </div>
        <div class="item">
                <div class="container">
                    <h3>Header 3</h3>
                    <h1 class="col-md-9">Some text </h1> <a class="q-arrow-link text-white various fancybox.iframe" href="https://www.youtube.com/embed/-NSvbGxzpKk?autoplay=1"> watch video 2 </a>
                </div><img class="main-image" src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBw0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ8NDQ0NFREWFhURExMYHSggGBolGxMVITEhJSkrLjo6Fx8zODMtNyg5LisBCgoKDQ0NDw8NDzcZFRkrKysrLS0rLS03KzcrKy0rKzctNy0tKysrNy0rLSsrNystKystLS0tKysrKysrKysrK//AABEIAKgBLAMBIgACEQEDEQH/xAAbAAEBAQEBAQEBAAAAAAAAAAADAgABBAUHBv/EABkQAQEBAQEBAAAAAAAAAAAAAAACARIRA//EABkBAQEBAQEBAAAAAAAAAAAAAAMCAQQABf/E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3Ubrm0n1JZHd1zdc9TusVI1ajdbdRupXI1aOtdrR1qaWRNaOtVuo1NLImtHur0Vai0uY/n50s06z5+a+rqEmizTjElDqFmiTTMuUVi8os0zElDqGinoimYsrn3DxRppmLHNqGmlzTMuUNi5ok0zKHYvKVlszR2O9uduM17jvTm0zPPcRVjq2Zi5B1Q6pmT0sid1z1mT1bm6ndZmdbIjdRuszLSQe6itZk2kiN1G6zItJB1oqpmHqmzH/2Q==">
        </div>
        </div>
    </div><a class="carousel-control left" data-slide="prev" href="#carousel"></a> <a class="carousel-control right" data-slide="next" href="#carousel"></a>

CSS

.carousel.fade {
  opacity: 5;
}
.carousel.fade .item {
  transition: opacity ease-in 1s;
  left: 0;
  opacity: 0; /* hide all slides */
  top: 0;
  position: absolute;
  width: 100%;
  display: block;
}

.carousel.fade .item h3.text-white.title {
  transition: opacity ease-in 3s
  }


.carousel.fade .item:first-child {
  top: auto;
  opacity: 0; /* show first slide */
  position: relative;

}

.carousel.fade .item.active {
  opacity: 1;

}
4
  • 1
    Can you point to the jsFiddle where it isn't working. This would help us see your configuration. Commented May 16, 2016 at 13:40
  • 2
    You need to call Jquery before bootstrap Commented May 16, 2016 at 13:41
  • 2
    You are loading bootstrap before jquery. Commented May 16, 2016 at 13:41
  • 1
    The load order matters: jsfiddle.net/bsj0nsng/2 . If you use devTool to inspect, you'll see an error bootstrap.min.js:6 Uncaught Error: Bootstrap's JavaScript requires jQuery , so you just need to change the load order, put boostrap.min.js after jquery.min.js Commented May 16, 2016 at 13:42

2 Answers 2

1

In your jsfiddle the bootstrap.min.js is included before jquery, which it is dependant on. If you change the order so that jquery goes first, everything works just fine: http://jsfiddle.net/d55t7hfa/

Sign up to request clarification or add additional context in comments.

Comments

1

Bootstrap's javascript requires jQuery to be loaded. You have it before the jQuery script, so it fires an error (that you can see in the console) - "Error: Bootstrap's JavaScript requires jQuery". Switch the places of those scripts (1. jQuery, 2. Bootstrap.js) and you'll be fine

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.