Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1321698

    Hi there,

    We are using an image with a lot of hot spots for a school campus map. We have set the tooltip to always appear under the image on mobile, but because we have so many hot spots the page is really long to see all tooltips. Is there a way to make the hot spots jump-to links on Moble?

    #1321844

    Hey jaimemerz,

    Thank you for the inquiry.

    You can add the following script in the functions.php file to make the document scroll to the position of the fallback tooltip when a corresponding hotspot is clicked.

    add_action("wp_footer", function() {
    ?>
    <script>
    (function($) {
        $(".av-image-hotspot").on("click", function() {
            var number = $(this)[0].classList[2];
    
            $('html, body').animate({
                scrollTop: $(".av-hotspot-fallback-tooltip." + number).offset().top
            }, 500);
        });
    })(jQuery);
    </script>
    <?php
    }, 999);
    

    Please make sure to copy the code directly from the forum. Let us know how it goes.

    Best regards,
    Ismael

    #1322074

    This worked like a charm! Thank you!!

    #1322191

    Hi,

    Great, I’m glad that Ismael could help you out. Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.