Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • #1194127

    Hi there,

    I’m experiencing the same problem as reported here:
    In short, the page scrolls up by a small amount when a custom Lightbox is opened.

    However the solution, add .no-scroll class to the popup link won’t work for me, as the popup link is buried in a Masonry Gallery element, which I can only add a custom link to, i.e no html or classes etc. So the question is how to add custom class to that tag?

    Many thanks.


    Hey ATB_IO,

    Could you please give us a link to your website, we need more context to be able to help you.

    Best regards,

    This reply has been marked as private.

    Hi ATB_IO,

    You added an anchor link to the first masonry item, the browser thinks there is an element on the page with that id and tries to scroll to it. The no-scroll you added with a dot and it does not work in the html like this. there should be no buttons here. Please remove.

    Best regards,


    Hi Victoria,

    My mistake with the dot – it doesn’t work anyway, as it places the class into the wrong container.
    I added the anchor link in the Custom Link option of the masonry item, as it was the only means I could find by which to trigger the popup to open from a masonry element. If this is causing the scrolling issue, would you have a better means of launching the popup? there should be no buttons here. Please remove.

    I’m afraid I don’t understand what buttons you are referring to.

    Many thanks


    Sorry for the late reply, to add the class “no-scroll” to your masonry element try adding this code to the end of your functions.php file in Appearance > Editor:

    function custom_script(){
    add_action('wp_footer', 'custom_script');

    Then clear your browser cache and check.

    Best regards,


    Brilliant, works a charm! Thanks Mike :)

    Best regards.



    I’m glad this was resolved. If you need additional help, please let us know here in the forums.

    Best regards,
    Jordan Shannon

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Add custom class to individual Masonry Gallery elements’ is closed to new replies.