• Resolved bhkh

    (@bhkh)


    Hello!

    Is there a setting to add some sort of “return to top” link or button to the letter headings? For example

    G (top)

    I’m using your plugin to create a single column. As the page gets longer, it would be helpful to have a way for users to get back to the #mcTagMapNav id.

    I am able to add this by changing mctagmap_functions.php. I have added
    <a href="#mcTagMapNav">(top)</a>
    to line 1005

    Is there a builtin way to do this? Is the code I have added problematic?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author tugbucket

    (@tugbucket)

    Hi,

    What you did has one big issue. If you update the plugin your addition will be overwritten.

    There isn’t any option to add a button for this because it would be really dependent on other settings people may use. I would suggest something like:

    $('#mcTagMap').append('<a href="#mcTagMapNav" class="mctm_scrolltop">(top)</a>');
    $(document).on('click', '.mctm_scrolltop', function() {
    	$('html, body').animate({
    		scrollTop: $("#mcTagMap").offset().top + (-50)
    	}, 2000);
    });

    You could add that to your themes JS file. It will insert the link at the and of the map like your code does. I also added a class so you can style is better. The onclick() will scroll to 50px above the map so nothing gets cut off.

    Hope that helps some an thanks for using my plugin.

    Thread Starter bhkh

    (@bhkh)

    Thanks so much!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Return to top link’ is closed to new replies.