Error in SCROLL function inside Onclick

Asked

Viewed 76 times

1

Good afternoon Guys, a week or so a customer came complaining that the link from his site was not working and I could not understand why, because the site was delivered working, it was a link that simply rolled the page. This week then I realized that the same kind of link stopped working on other sites of mine, and it’s a scroll function that I’ve used for a long time, and it’s presenting an error that I haven’t been able to decipher, someone can give me a help?

I am putting in the images below the code of the link that makes the function call by onclick, the error and also the js function that I am using.

Erro do Navegador Chamada do onclick para scroll Função em jQuery

  • I’ve tried it directly on the Chrome console to call the scroll() function and it works correctly, I realized then that the error is in onclick, but what would be?

  • The following sites are sites that I have already made and are giving this problem: • http://braganca.adv.br (scroll link is at the top) • http://happyday-es.com.br (scroll link is at parties at the top)

1 answer

1


From what I’ve read, the function scroll being called does not correspond to his authorship but to the function scroll window., receiving different parameters, causing this error in Chrome.

Try to rename your function and check if your problem will be solved.

Doing a quick test here declaring a function with another name on the console and changing the onclick to call this function, the scrolling worked perfectly.

  • 1

    Thank you Breno Costa, it worked perfectly.

  • 1

    I had not considered this because when I called the function by the console, without the onclick it worked. So the same problem was in the scroll inside the onclick.

  • For nothing! Otherwise, the mysteries remain in the implementations of the API’s by the browsers.. kkk

Browser other questions tagged

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