WordPress.org

Ready to get started?Download WordPress

Forums

Gallery Slideshow
Adaptative Vertical Position (5 posts)

  1. BrunoSousa
    Member
    Posted 3 months ago #

    Hi, it's me again! =]

    I had images in gallery with different height values. The gallery was calculating the container height based on the height of first image, and it's was stretching high images to fill the container. Then, I changed the CSS max-height: 100%; to max-height: auto, and high images doesn't stretch anymore.

    But, I've got another problem.. =/
    E g. when I have a first image with a 500px height, the gallery vertical align is based on this height value. But, if my second image has 1000px height, the gallery remains vertically-aligned at 500px, and my second image overlap the Header and other elements gallery above .

    I'd like to know if have any way to automatically adapt the vertical align of the gallery in a page, based in each height size from each image.

    You can see my gallery and this issue at: http://carlapimenteldecastro.arq.br/apartamento-setor-oeste/

    Sorry about my poor english and thank you in advance.

    Bruno.

    https://wordpress.org/plugins/gallery-slideshow/

  2. jethin
    Member
    Plugin Author

    Posted 3 months ago #

    Hi Bruno. I'm not 100% sure what you want to do, but the second image in your gallery is scaling outside the slideshow canvas because 1) you removed the max-height: 100% rule from img.cycle-slide and 2) this rule, which enlarges it to the canvas width:

    #conteudo_projeto img {
    width: 100%;
    }

    I'd recommend reverting to the default css rules. If you want you can set your slideshow's canvas height to a specific image using this option:

    options="auto-height=1"

    Note: the slide index number is zero based.

    See the auto-height documentation on the Cycle2 site for more info.

    Let us know if this works for you. Thanks.

  3. BrunoSousa
    Member
    Posted 3 months ago #

    Hi Jethin.

    I found the solution for my issue.

    I added the container resize option as explained in Cycle2 documentation: http://jquery.malsup.com/cycle2/demo/container-resize.php

    I added to gss_html.php the option "data-cycle-auto-height=container", in line #58, like this: html .= '<div class="cycle-slideshow" data-cycle-auto-height=container

    To works fine, I removed the img.cycle-slide {max-height:100%;} and .carousel-pager .cycle-slide img { height: 100%; } options from gss.css.

    You can see my gallery working as I expected: http://carlapimenteldecastro.arq.br/casa-1-jardins-valencia/

    Thanks for your support and hope this can help anyone.

  4. jethin
    Member
    Plugin Author

    Posted 2 months ago #

    Hi Bruno. Glad to hear it worked out. A suggestion: don't edit "core" files -- your changes will be overwritten if you update the plugin at some point. You can use your own (or a separate) stylesheet to override any css rules. And "data-cycle-...' options can be passed to your slideshow using the 'options' shortcode attribute, in your case like so:

    [gss ids="1,2,3..." options="auto-height=container"]

    Thanks.

  5. jethin
    Member
    Plugin Author

    Posted 2 months ago #

    PS: if you use this code your slideshow canvas will automatically resize to the tallest slide/image:

    [gss ids="1,2,3..." options="auto-height=calc"]

    I personally feel this would be better as the navigation wouldn't jump around. However, because your images have different heights there would be some "white space" at the top of the slideshow canvas when a shorter image is being displayed.

Reply

You must log in to post.

About this Plugin

About this Topic