admin管理员组

文章数量:1387328

On researching the question "How to animate height change on Bootstrap 3 Carousel" I found this answer, however it doesn't have any effects on my bootstrap carousel. I can't ment yet and ask for clarification there, therefore a new Question.

The solution suggested there is

function bsCarouselAnimHeight()
{
$('.carousel').carousel({
    interval: 5000
}).on('slide.bs.carousel', function (e)
{
    var nextH = $(e.relatedTarget).height();
    $(this).find('.active.item').parent().animate({ height: nextH }, 500);
});
}

But as I said, without any effect. Maybe I should modify any selectors in the Javascript in my case?

Update:

I updated the fiddle so it's actually showing the problem.

All ideas are appreciated! Thanks.

On researching the question "How to animate height change on Bootstrap 3 Carousel" I found this answer, however it doesn't have any effects on my bootstrap carousel. I can't ment yet and ask for clarification there, therefore a new Question.

The solution suggested there is

function bsCarouselAnimHeight()
{
$('.carousel').carousel({
    interval: 5000
}).on('slide.bs.carousel', function (e)
{
    var nextH = $(e.relatedTarget).height();
    $(this).find('.active.item').parent().animate({ height: nextH }, 500);
});
}

But as I said, without any effect. Maybe I should modify any selectors in the Javascript in my case?

Update:

I updated the fiddle so it's actually showing the problem.

All ideas are appreciated! Thanks.

Share Improve this question edited Jun 20, 2020 at 9:12 CommunityBot 11 silver badge asked May 9, 2014 at 12:16 psteinweberpsteinweber 81312 silver badges21 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 7

Your code is fine. You're just not calling function bsCarouselAnimHeight() anywhere so none of it is firing.

You can either take it out of the function declaration

http://jsfiddle/4HDBe/3/

or call the function at some point.

http://jsfiddle/4HDBe/4/

本文标签: javascriptAnimate height change on Bootstrap 3 CarouselStack Overflow