Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anyway to set the caption below the image? #176

Open
lrmandell opened this issue Apr 12, 2014 · 3 comments
Open

Anyway to set the caption below the image? #176

lrmandell opened this issue Apr 12, 2014 · 3 comments

Comments

@lrmandell
Copy link

I've been looking for a slider that meets all of my requirements for a while and this on is as close as I've come to finding one. I really appreciate the basic concept on a simple slider that I can customize to meet my needs. The one thing I haven't bee able to accomplish is have the caption below the image. Setting the bottom to a negative number pushes the caption down but it's not visible (since it's contained within the image li?) Z-index doesn't seem to help either. If this isn't possible right now adding this feature would make this meet all of my slider requirements.

@MHenderson
Copy link

+1

@lrmandell
Copy link
Author

Figured out how to do this with css.
Add padding to your image (in my case: li.bjqs-slide img { padding-bottom: 3em ; } )
Change overflow to visible in ul.bjqs
set you position: absolute location to a negative value (in my case p.bjqs-caption{ position: absolute ; bottom: -3.5em ;})

It not perfect - I haven't figured out how to gracefully deal with 2 line captions but it's close enough to what I need.

@topada
Copy link

topada commented Aug 5, 2014

i created a quick and dirty work around.

  1. In my own javascript right before I start the bjqs-slider I added an additional div-container
$('#image-slider').append("<div class='bjqs-alt-caption'></div>");
  1. In the bjqs.js I added my own configuration
var conf_alt_captions = function() {
       $.each($slides, function (key, slide) {
                var caption = $(slide).children('img:first-child').attr('title');
               // Account for images wrapped in links
                if(!caption){
                    caption = $(slide).children('a').find('img:first-child').attr('title');
                }
                if (caption) {
                    caption = $('<p class="bjqs-caption alt ">' + caption + '</p>');
                    $(".bjqs-alt-caption").append(caption); // caption gets added to the costum div-container
                }

            });
            $(".alt").eq(state.currentindex).show(); //show the first element
        };
  1. For my purposes i only needed the fade-animation to work, so i added this within the go-functions fade-case:
// fade out alt caption
$(".alt").eq(state.currentindex).fadeOut(settings.aniduration);
$(".alt").eq(state.nextindex).fadeIn(settings.aniduration);
  1. In the bjqs.css i added the following lines
#image-slider{ margin-bottom: 3.5em; }
p.bjqs-caption.alt {display:none; bottom: -3.5em; height: 3.5em; background-color: #FFFFFF; text-align: center; }

check it out here: http://skulptour.eu/posts/stander-und-sockel-fur-skulpturen/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants