WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. Brandon Shutter
    Member
    Posted 9 months ago #

    Currently I have my slider setup like this:
    http://i.imgur.com/K3Mi6ep.jpg

    On the left side is a div called sliderdescription.

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

    $(".carousel-caption")
    .appendTo(".sliderdescription");

    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?

    Thanks!

    http://wordpress.org/plugins/cpt-bootstrap-carousel/

  2. Phil Ewels
    Member
    Plugin Author

    Posted 8 months 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..

    Cheers,

    Phil

  3. Brandon Shutter
    Member
    Posted 8 months ago #

    Phil!

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

Reply

You must log in to post.

About this Plugin

About this Topic