CPT Bootstrap Carousel
[resolved] Carousel Caption outside of slider (3 posts)

  1. Brandon Shutter
    Posted 2 years ago #

    Currently I have my slider setup like this:

    On the left side is a div called sliderdescription.

    Using JS I'm appending the caption to the div like so:


    However, this is showing all the captions, and not just the one being used by the current slide.

    How would I got about making this only show up for the current slide?



  2. Phil Ewels
    Plugin Author

    Posted 2 years ago #

    Hi Brandon,

    Apologies for the delay - I missed the notification e-mail about your post for some reason. This isn't really a query about the CPT Bootstrap Carousel wordpress plugin as such, more just about the bootstrap carousel, but I'll see if I can get you started..

    By using .appendTo you're moving all of the captions into your div. These are normally held within divs which are moved and displayed by the carousel, but now they're outside of that environment they are no longer controlled by the carousel and all display on top of each other.

    To get them to show and hide as you'd like them to, you need to code up some animations yourself manually. Depending on the effect you're going for, you'll probably need to hide them all ($(".carousel-caption").hide();) and then show them individually as their carousel image is shown. Bootstrap carousel thankfully has javascript events that fire as the slides change which you should be able to use - slide.bs.carousel and slid.bs.carousel.

    Hopefully that will be enough to get you on your way. If you need any more help I'd recommend putting your question up at stackoverflow.com or somewhere..



  3. Brandon Shutter
    Posted 2 years ago #


    Thank you for your help, I appreciate the response. I ended up getting it working :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • CPT Bootstrap Carousel
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic