How to Enable Bootstrap 4 Carousel Inside a Bootstrap Popover









up vote
1
down vote

favorite












can you please take a look at this demo and let me know why controll buttons are not working on Bootstrap 4 Carousel Inside a Bootstrap Popover? As you can see The carousel is working as I already added



$("[data-toggle=popover]").on('shown.bs.popover', function () 
$('.carousel-inner').carousel();
);


but controls are not working






$("[data-toggle=popover]").each(function(i, obj) 
$(this).popover(
html: true,
content: function()
var id = $(this).attr('id')
return $('#popover-content-' + id).html();

);

);

$("[data-toggle=popover]").on('shown.bs.popover', function()
$('.carousel-inner').carousel();
);

.carousel-inner img 
width: 100%;
height: 100%;

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
<div class="container">
<a class="btn btn-primary" data-toggle="popover" data-container="body" data-placement="right" type="button" data-html="true" href="#" id="login">Display</a>

<div id="popover-content-login" class="d-none">
<div id="demo" class="carousel slide" data-ride="carousel">

<!-- Indicators -->
<ul class="carousel-indicators">
<li data-target="#demo" data-slide-to="0" class="active"></li>
<li data-target="#demo" data-slide-to="1"></li>
<li data-target="#demo" data-slide-to="2"></li>
</ul>

<!-- The slideshow -->
<div class="carousel-inner">
<div class="carousel-item active">
<img src="https://www.w3schools.com/bootstrap4/la.jpg" alt="Los Angeles" width="1100" height="500">
</div>
<div class="carousel-item">
<img src="https://www.w3schools.com/bootstrap4/chicago.jpg" alt="Chicago" width="1100" height="500">
</div>
<div class="carousel-item">
<img src="https://www.w3schools.com/bootstrap4/ny.jpg" alt="New York" width="1100" height="500">
</div>
</div>

<!-- Left and right controls -->
<a class="carousel-control-prev" href="#demo" data-slide="prev">
<span class="carousel-control-prev-icon"></span>
</a>
<a class="carousel-control-next" href="#demo" data-slide="next">
<span class="carousel-control-next-icon"></span>
</a>
</div>
</div>

</div>












share|improve this question





















  • Can you try adding container: 'body' to your popover options?
    – TheUnreal
    Nov 11 at 16:59










  • Thanks TheUnreal, I did! nothing changed!
    – Behseini
    Nov 12 at 2:50














up vote
1
down vote

favorite












can you please take a look at this demo and let me know why controll buttons are not working on Bootstrap 4 Carousel Inside a Bootstrap Popover? As you can see The carousel is working as I already added



$("[data-toggle=popover]").on('shown.bs.popover', function () 
$('.carousel-inner').carousel();
);


but controls are not working






$("[data-toggle=popover]").each(function(i, obj) 
$(this).popover(
html: true,
content: function()
var id = $(this).attr('id')
return $('#popover-content-' + id).html();

);

);

$("[data-toggle=popover]").on('shown.bs.popover', function()
$('.carousel-inner').carousel();
);

.carousel-inner img 
width: 100%;
height: 100%;

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
<div class="container">
<a class="btn btn-primary" data-toggle="popover" data-container="body" data-placement="right" type="button" data-html="true" href="#" id="login">Display</a>

<div id="popover-content-login" class="d-none">
<div id="demo" class="carousel slide" data-ride="carousel">

<!-- Indicators -->
<ul class="carousel-indicators">
<li data-target="#demo" data-slide-to="0" class="active"></li>
<li data-target="#demo" data-slide-to="1"></li>
<li data-target="#demo" data-slide-to="2"></li>
</ul>

<!-- The slideshow -->
<div class="carousel-inner">
<div class="carousel-item active">
<img src="https://www.w3schools.com/bootstrap4/la.jpg" alt="Los Angeles" width="1100" height="500">
</div>
<div class="carousel-item">
<img src="https://www.w3schools.com/bootstrap4/chicago.jpg" alt="Chicago" width="1100" height="500">
</div>
<div class="carousel-item">
<img src="https://www.w3schools.com/bootstrap4/ny.jpg" alt="New York" width="1100" height="500">
</div>
</div>

<!-- Left and right controls -->
<a class="carousel-control-prev" href="#demo" data-slide="prev">
<span class="carousel-control-prev-icon"></span>
</a>
<a class="carousel-control-next" href="#demo" data-slide="next">
<span class="carousel-control-next-icon"></span>
</a>
</div>
</div>

</div>












share|improve this question





















  • Can you try adding container: 'body' to your popover options?
    – TheUnreal
    Nov 11 at 16:59










  • Thanks TheUnreal, I did! nothing changed!
    – Behseini
    Nov 12 at 2:50












up vote
1
down vote

favorite









up vote
1
down vote

favorite











can you please take a look at this demo and let me know why controll buttons are not working on Bootstrap 4 Carousel Inside a Bootstrap Popover? As you can see The carousel is working as I already added



$("[data-toggle=popover]").on('shown.bs.popover', function () 
$('.carousel-inner').carousel();
);


but controls are not working






$("[data-toggle=popover]").each(function(i, obj) 
$(this).popover(
html: true,
content: function()
var id = $(this).attr('id')
return $('#popover-content-' + id).html();

);

);

$("[data-toggle=popover]").on('shown.bs.popover', function()
$('.carousel-inner').carousel();
);

.carousel-inner img 
width: 100%;
height: 100%;

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
<div class="container">
<a class="btn btn-primary" data-toggle="popover" data-container="body" data-placement="right" type="button" data-html="true" href="#" id="login">Display</a>

<div id="popover-content-login" class="d-none">
<div id="demo" class="carousel slide" data-ride="carousel">

<!-- Indicators -->
<ul class="carousel-indicators">
<li data-target="#demo" data-slide-to="0" class="active"></li>
<li data-target="#demo" data-slide-to="1"></li>
<li data-target="#demo" data-slide-to="2"></li>
</ul>

<!-- The slideshow -->
<div class="carousel-inner">
<div class="carousel-item active">
<img src="https://www.w3schools.com/bootstrap4/la.jpg" alt="Los Angeles" width="1100" height="500">
</div>
<div class="carousel-item">
<img src="https://www.w3schools.com/bootstrap4/chicago.jpg" alt="Chicago" width="1100" height="500">
</div>
<div class="carousel-item">
<img src="https://www.w3schools.com/bootstrap4/ny.jpg" alt="New York" width="1100" height="500">
</div>
</div>

<!-- Left and right controls -->
<a class="carousel-control-prev" href="#demo" data-slide="prev">
<span class="carousel-control-prev-icon"></span>
</a>
<a class="carousel-control-next" href="#demo" data-slide="next">
<span class="carousel-control-next-icon"></span>
</a>
</div>
</div>

</div>












share|improve this question













can you please take a look at this demo and let me know why controll buttons are not working on Bootstrap 4 Carousel Inside a Bootstrap Popover? As you can see The carousel is working as I already added



$("[data-toggle=popover]").on('shown.bs.popover', function () 
$('.carousel-inner').carousel();
);


but controls are not working






$("[data-toggle=popover]").each(function(i, obj) 
$(this).popover(
html: true,
content: function()
var id = $(this).attr('id')
return $('#popover-content-' + id).html();

);

);

$("[data-toggle=popover]").on('shown.bs.popover', function()
$('.carousel-inner').carousel();
);

.carousel-inner img 
width: 100%;
height: 100%;

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
<div class="container">
<a class="btn btn-primary" data-toggle="popover" data-container="body" data-placement="right" type="button" data-html="true" href="#" id="login">Display</a>

<div id="popover-content-login" class="d-none">
<div id="demo" class="carousel slide" data-ride="carousel">

<!-- Indicators -->
<ul class="carousel-indicators">
<li data-target="#demo" data-slide-to="0" class="active"></li>
<li data-target="#demo" data-slide-to="1"></li>
<li data-target="#demo" data-slide-to="2"></li>
</ul>

<!-- The slideshow -->
<div class="carousel-inner">
<div class="carousel-item active">
<img src="https://www.w3schools.com/bootstrap4/la.jpg" alt="Los Angeles" width="1100" height="500">
</div>
<div class="carousel-item">
<img src="https://www.w3schools.com/bootstrap4/chicago.jpg" alt="Chicago" width="1100" height="500">
</div>
<div class="carousel-item">
<img src="https://www.w3schools.com/bootstrap4/ny.jpg" alt="New York" width="1100" height="500">
</div>
</div>

<!-- Left and right controls -->
<a class="carousel-control-prev" href="#demo" data-slide="prev">
<span class="carousel-control-prev-icon"></span>
</a>
<a class="carousel-control-next" href="#demo" data-slide="next">
<span class="carousel-control-next-icon"></span>
</a>
</div>
</div>

</div>








$("[data-toggle=popover]").each(function(i, obj) 
$(this).popover(
html: true,
content: function()
var id = $(this).attr('id')
return $('#popover-content-' + id).html();

);

);

$("[data-toggle=popover]").on('shown.bs.popover', function()
$('.carousel-inner').carousel();
);

.carousel-inner img 
width: 100%;
height: 100%;

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
<div class="container">
<a class="btn btn-primary" data-toggle="popover" data-container="body" data-placement="right" type="button" data-html="true" href="#" id="login">Display</a>

<div id="popover-content-login" class="d-none">
<div id="demo" class="carousel slide" data-ride="carousel">

<!-- Indicators -->
<ul class="carousel-indicators">
<li data-target="#demo" data-slide-to="0" class="active"></li>
<li data-target="#demo" data-slide-to="1"></li>
<li data-target="#demo" data-slide-to="2"></li>
</ul>

<!-- The slideshow -->
<div class="carousel-inner">
<div class="carousel-item active">
<img src="https://www.w3schools.com/bootstrap4/la.jpg" alt="Los Angeles" width="1100" height="500">
</div>
<div class="carousel-item">
<img src="https://www.w3schools.com/bootstrap4/chicago.jpg" alt="Chicago" width="1100" height="500">
</div>
<div class="carousel-item">
<img src="https://www.w3schools.com/bootstrap4/ny.jpg" alt="New York" width="1100" height="500">
</div>
</div>

<!-- Left and right controls -->
<a class="carousel-control-prev" href="#demo" data-slide="prev">
<span class="carousel-control-prev-icon"></span>
</a>
<a class="carousel-control-next" href="#demo" data-slide="next">
<span class="carousel-control-next-icon"></span>
</a>
</div>
</div>

</div>





$("[data-toggle=popover]").each(function(i, obj) 
$(this).popover(
html: true,
content: function()
var id = $(this).attr('id')
return $('#popover-content-' + id).html();

);

);

$("[data-toggle=popover]").on('shown.bs.popover', function()
$('.carousel-inner').carousel();
);

.carousel-inner img 
width: 100%;
height: 100%;

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
<div class="container">
<a class="btn btn-primary" data-toggle="popover" data-container="body" data-placement="right" type="button" data-html="true" href="#" id="login">Display</a>

<div id="popover-content-login" class="d-none">
<div id="demo" class="carousel slide" data-ride="carousel">

<!-- Indicators -->
<ul class="carousel-indicators">
<li data-target="#demo" data-slide-to="0" class="active"></li>
<li data-target="#demo" data-slide-to="1"></li>
<li data-target="#demo" data-slide-to="2"></li>
</ul>

<!-- The slideshow -->
<div class="carousel-inner">
<div class="carousel-item active">
<img src="https://www.w3schools.com/bootstrap4/la.jpg" alt="Los Angeles" width="1100" height="500">
</div>
<div class="carousel-item">
<img src="https://www.w3schools.com/bootstrap4/chicago.jpg" alt="Chicago" width="1100" height="500">
</div>
<div class="carousel-item">
<img src="https://www.w3schools.com/bootstrap4/ny.jpg" alt="New York" width="1100" height="500">
</div>
</div>

<!-- Left and right controls -->
<a class="carousel-control-prev" href="#demo" data-slide="prev">
<span class="carousel-control-prev-icon"></span>
</a>
<a class="carousel-control-next" href="#demo" data-slide="next">
<span class="carousel-control-next-icon"></span>
</a>
</div>
</div>

</div>






javascript jquery twitter-bootstrap bootstrap-4






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 11 at 16:52









Behseini

2,260154283




2,260154283











  • Can you try adding container: 'body' to your popover options?
    – TheUnreal
    Nov 11 at 16:59










  • Thanks TheUnreal, I did! nothing changed!
    – Behseini
    Nov 12 at 2:50
















  • Can you try adding container: 'body' to your popover options?
    – TheUnreal
    Nov 11 at 16:59










  • Thanks TheUnreal, I did! nothing changed!
    – Behseini
    Nov 12 at 2:50















Can you try adding container: 'body' to your popover options?
– TheUnreal
Nov 11 at 16:59




Can you try adding container: 'body' to your popover options?
– TheUnreal
Nov 11 at 16:59












Thanks TheUnreal, I did! nothing changed!
– Behseini
Nov 12 at 2:50




Thanks TheUnreal, I did! nothing changed!
– Behseini
Nov 12 at 2:50

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53250996%2fhow-to-enable-bootstrap-4-carousel-inside-a-bootstrap-popover%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53250996%2fhow-to-enable-bootstrap-4-carousel-inside-a-bootstrap-popover%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Top Tejano songwriter Luis Silva dead of heart attack at 64

政党

天津地下鉄3号線