Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1307301

    Hi
    I have a multilingual Site (WPML). In the german version of the blog masonry the last element is centered (margin-left:33%. In the other language versions (EN, FR) the last element is positioned at the left side as it should be. I do not find the problem not to mention a possible solution. I would be glad if you could provide me with some help.
    Thanks!

    #1307617

    Hey Fabian J.,
    Thank you for your patience and the link to your site, when I check your page the last element is centered in all languages when the sort is “ALLE”. What is happening is the css for all of the items is set by javascript and uses absolute positioning, when the sort options are used the other items are still there in the source, just not shown, so it may look like there is one item to the left, but there is really more. Anyways I was able to put together a solution for you with this css:

    .av-masonry-container:not([id]) #av-masonry-1-item-9759,
    .av-masonry-container#masonry_id_all_sort #av-masonry-1-item-9759 {
    	left: 0 !important;
    }

    it sets the last item to left zero if no sort is clicked, like on page load, and when the “ALLE” sort is clicked.

    Best regards,
    Mike

    #1307927

    Hey Mike
    Thanks for the solution. However, I have a few other related questions:
    1) Am I right in assuming that the solution only works as long as the last element carries the ID 9759?
    (If the answer is “yes”, this would mean that the solution would only be temporary.)
    2) Why is the last image centered only in the DE version, but not in the other language versions (EN/FR)?
    3) If 1 = yes, does a permanent solution exist?
    Strange thing is that I used the masonry in a lot of other websites and this is the first time this problem occurrs.
    Best regards,
    Fabian

    • This reply was modified 3 years, 3 months ago by artes.
    #1307938

    Hi,
    Thank you for the feedback, from what I see on your page /angebote/ last element is centered in all languages when the sort is “ALLE” or on page load, on Windows 10 this is true in Chrome, Firefox, & Edge, so the last image is not centered only in the DE version, I didn’t find why this is other that the javascript css:

    element.style {
        position: absolute;
        left: 33.2994%;
        top: 832.6px;
    }

    the masonry container is using float: left;
    only one of the other pages you linked to shows a single item at the end and that one is set to landscape mode which takes 2/3 of the screen. If you plan on adding more items, try adding one more now and see if that helps. Also try disabling your cache plugin and any minification, I recall a multiple layer caching & minification that caused some odd masonry behavior in the past.

    Best regards,
    Mike

    #1308115

    Ok, it is what it is – and it’s interesting. Anyway, you can close this topic. Thank you very much for your help.
    Best regards,
    Fabian

    #1308306

    Hi,
    Sorry we were not more help with this, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Blog masonry – last element shoud not be centered’ is closed to new replies.