I'm using a script that when triggered positions me into a specific div
, it's working, but the code I have does this from a link
text and I'm trying to fit it into an image and that the same as another div
.
The image I need is this:
ThescriptIhaveisthis:
Whattriggers:
<ahref="#bottom" id="top">Clique para Posiconar</a>
What positions:
$('a[href^="#"]').on('click', function(event) {
var target = $( $(this).attr('href') );
if( target.length ) {
event.preventDefault();
$('html, body').animate({
scrollTop: target.offset().top
}, 1000);
}
});
The page with the code working so far can be seen here: