Community @ The Turning Gate

Support community for TTG plugins and products.

NOTICE

The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.

This forum is now closed, and exists here as a read-only archive.

  • New user registrations are disabled.
  • Users cannot create new topics.
  • Users cannot reply to existing topics.

You are not logged in.

#1 2016-03-20 06:39:31

trummonte
Member
From: Buena Vista, Colorado
Registered: 2012-11-11
Posts: 178
Website

Back to top button

I finally got this to work and thought I would pass along for anyone that would like to use it.

Scroll down the page to have the button show up on the bottom right: https://portfolios.montetrumbull.com/ga … andscapes/

Goes in phplugins file:

function ttg_body_bottom( $style, $path ) {
    echo '
    <a href="#top" class="btn-scroll-to-top" title="Top of page"><i class="fa fa-chevron-circle-up fa-fw fa-lg"></i></a>
   
    <script>
    $(document).ready(function() {
        $(".btn-scroll-to-top").click(function() {
            $("html, body").animate({ scrollTop: 0 }, "slow");
            return false;
        });

        $(window).scroll(function() {
            if ($(this).scrollTop() > 100) {
                $(".btn-scroll-to-top").fadeIn();
            } else {
                $(".btn-scroll-to-top").fadeOut();
            }
        });
    });
    </script>
    ';
}

Goes in custom.css:

/* Back to Top Button */

.btn-scroll-to-top {
    background-color: transparent;
    display: none;
    position: fixed;
    bottom: 5px;
    right: 5px;
    padding: 5px;
    font-size: 36px !important;
    text-align: center;
    text-decoration: none;
    color:#D0D0D0;
}
.btn-scroll-to-top:hover {
    text-decoration: none;
    color:#FFFFFF;
}

Offline

Board footer

Powered by FluxBB