Community @ The Turning Gate

Support community for TTG plugins and products.

You are not logged in.

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

trummonte
Member
From: Buena Vista, Colorado
Registered: 2012-11-11
Posts: 158
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