-2
If it was noon and I could not find the problem, a fact that I thought was simple. The Jquery documentation contains: $( "#book" ).({
I’ve tried adding a newer, older Jquery, but it won’t. A simple scroll script that I need to implement does not work.
function scrollToAnchor(aid) {
var aTag = $("a[name='" + aid + "']");
$('html,body').animate({
scrollTop: aTag.offsetTop
}, 'slow');
}
$("#quem-somos").on('click', function() {
scrollToAnchor('section-quem-somos');
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<a class="menu__item" href="#" id="quem-somos">
<span class="menu__item-name">Quem somos</span>
</a>
<section class="bloco_historia" id="section-quem-somos">Bloco</section>
He’s near the baseboard. If I switch to the head, it’s no mistake, but it doesn’t work either.
Why in jQuery you search for the tag
<a>
that has the attributename
where its element does not possess such an attribute? Moreover, neither an element<a>
he is, is a<section>
who owns theid
.– Woss
Got it. But I changed the name to id, but nothing yet.
– Agência Move
And changed the
a
forsection
?– Woss