This topic contains 5 replies, has 2 voices, and was last updated by  dnbboy 1 week ago.

Back to top

  • Hello,

    I have a problem with the back to top button, it dosn`t do anything when I click on it.

    Can you please have a look?

    Thank you!

    This reply has been marked as private.
    This reply has been marked as private.
    Tom

    Hi,

    Add code in /wp-content/themes/animer/functions.php:


    //* Fix backtotop </body>
    function animer_backtoTop() {
    echo
    '<script type="text/javascript">' .
    'jQuery(document).ready(function($) {' .
    "$('body').on('click', '#top-link', function(e) {" .
    "$('html, body').animate({scrollTop: 0}, 800);" .
    "e.preventDefault();" .
    '});' .
    '});' .
    '</script>';
    }
    add_action('wp_footer', 'animer_backtoTop', 9999);

    Tom

    ==============================================================

    //* Fix backtotop </body>
    function animer_backtoTop() {
    echo
    '<script type="text/javascript">' .
    'jQuery(document).ready(function($) {' .
    "$('body').on('click', '#top-link', function(e) {" .
    "$('html, body').animate({scrollTop: 0}, 800);" .
    "e.preventDefault();" .
    '});' .
    '});' .
    '</script>';
    }
    add_action('wp_footer', 'animer_backtoTop', 9999);

    Thank you a lot :)

You must be logged in to reply to this topic.