Find out which function is called in the click

Asked

Viewed 61 times

0

I have a site in wordpress and use Bootstrap 4.

In the footer I have a link to go back to the top of the page. When I click it shows the animation of the page going up.

I generated with javascript another link to go to the middle of the page. But the animation doesn’t work, it already appears in the middle.

The links are identical

<a href="#topo">Topo</a>
<a href="#meio">Meio</a>

<div id="topo">conteúdo</div>
<div id="meio">conteúdo</div>

Does anyone know why animation only works on the first link and not on the second?

  • What code Javascript of link half a?

1 answer

1


if with his managed with javasript another link, vc is meaning that is adding another javascript button to go to the middle of the page, you need to apply the Listener to this button, because the Listener of the button you are using to go to the top has already been run.

Or you can generate this button before applying your animation’s Listener to scroll for example.

  • The problem was this, had to generate the link before. thanks!!!

  • 1

    Good, I’m glad it all worked out

Browser other questions tagged

You are not signed in. Login or sign up in order to post.