Toggle navigation
Bootsnipp
Bootstrap
For
CSS Frameworks
Bootstrap
Foundation
Semantic UI
Materialize
Pure
Bulma
References
CSS Reference
Tools
Community
Page Builder
Form Builder
Button Builder
Icon Search
Dan's Tools
Diff / Merge
Color Picker
Keyword Tool
Web Fonts
.htaccess Generator
Favicon Generator
Site Speed Test
Snippets
Featured
Tags
By Bootstrap Version
4.1.1
4.0.0
3.3.0
3.2.0
3.1.0
3.0.3
3.0.1
3.0.0
2.3.2
Register
Login
"Carousel Inside Modal"
Bootstrap 3.2.0 Snippet by
miguelbustamante
3.2.0
jQuery
modal
carousel
Preview
HTML
CSS
JS
View Full Screen
Forked from
Fork
Fork this
Parent
2.0K
 
0 Fav
Post to Facebook
Tweet this
<link href="//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container text-center"> <h1> Click Me </h1> <!-- Large modal --> <div class'col-lg-3 col-md-3 col-xs-6 col-sm-6'> <a href="#" class="thumbnail" data-toggle='modal' data-target='.bs-example-modal-lg' style='width=150;'> <img src="http://placehold.it/1200x600/555/000&text=One" alt="..." width='150'> </a> </div> <!--<button class="btn btn-default" data-toggle="modal" data-target=".bs-example-modal-lg">Large modal</button>--> <div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div id="carousel-example-generic" class="carousel slide" data-ride="carousel"> <!-- Wrapper for slides --> <div class="carousel-inner"> </div> <!-- Controls --> <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev"> <span class="glyphicon glyphicon-chevron-left"></span> </a> <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next"> <span class="glyphicon glyphicon-chevron-right"></span> </a> </div> </div> </div> </div> </div>
body { padding-top: 20px; } .btn-default { top: 25%; left:25%; color: #999; background: #fffccc; }
$(function(){ var images = ["http://placehold.it/1200x600/555/000&text=One", "http://placehold.it/1200x600/fffccc/000&text=Two", "http://placehold.it/1200x600/fcf00c/000&text=Three"] $.each(images, function(key, value){ if(key == 0){ $('.carousel-inner').append( "<div class='item active'>" + "<img class='img-responsive' src='" + value + "' alt='...'>" + "</div>" ); } else { $('.carousel-inner').append( "<div class='item'>" + "<img class='img-responsive' src='" + value + "' alt='...'>" + "</div>" ); } }); })
Questions / Comments:
Post
Posting Guidelines
Formatting
- Now
×
Close
Donate
BTC: 12JxYMYi6Vt3mx3hcmP3B2oyFiCSF3FhYT
ETH: 0xCD715b2E3549c54A40e6ecAaFeB82138148a6c76