Support » Plugin: AddToAny Share Buttons » Max height above the footer

  • Resolved fjura

    (@fjura)



    Hello,

    may I ask if its possible to set the floating buttons to not go under a specific height? For example, if I would like them to stop at 500px above the footer and not go any lower.

    thank you

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author micropat

    (@micropat)

    It is possible! Add the following code to your “Additional JavaScript” box in AddToAny Settings:

    jQuery(window).scroll(function () {
        var scrollBottom = jQuery(document).height() - jQuery(window).height() - jQuery(window).scrollTop();
        if (scrollBottom > 500) {
            jQuery('.a2a_floating_style.a2a_vertical_style').show();
        } else {
            jQuery('.a2a_floating_style.a2a_vertical_style').hide();
        }
    });
    fjura

    (@fjura)

    awesome, but when now when I add the code, it overrides the settings where it is set to not show when the page is less than 980 pixels wide :/ And also the Css that states that it should not show on pages, category and HP:

    body.home .a2a_floating_style,
    body.page .a2a_floating_style,
    body.category .a2a_floating_style { display: none; }

    should I somehow update the code above so this settings also apply?

    thank you!

    • This reply was modified 1 year ago by  fjura.
    fjura

    (@fjura)

    and if you add the JS code, the floating buttons start to show also on Mobile.

    Plugin Author micropat

    (@micropat)

    Great point. To keep the existing functionality, use the !important declaration in your Additional CSS as so:

    @media screen and (max-width: 980px) {
      .a2a_floating_style.a2a_vertical_style { display: none !important; }
    }
    
    body.home .a2a_floating_style,
    body.page .a2a_floating_style,
    body.category .a2a_floating_style { display: none !important; }
    fjura

    (@fjura)

    perfect! thank you very much!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Max height above the footer’ is closed to new replies.