On my Wordpress site I have a link that target a specific page in a different domain. I need to open that page and directly scroll to a specific div (identified by its class). That div doesn't have an anchor and I have no control on its code so I cannot add it. On the target site you can scroll to that div by clicking a button that triggers the following js code:
$(".call-action").click(function() {
$('html, body').animate({
scrollTop: $(".tuoViaggio").offset().top-$("header").height()
}, 2000);
});
What are my options to directly move to the div with class tuoViaggio by leveraging only the href on my domain?
id
of an element (not sure if it's any element, but definitely<div>
). For instance, click here to get straight to the<div id="answers">
section of this question. So if there's a specific element with anid
you can use (instead of theclass
) in the destination, that could be a solution?