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?
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
This worked like a charm! Thank you!!