Onclick does not work in Firefox and IE

0

This function does not work in firefox and IE:

No javascript:

function scrollTo() {
   var _offset = 90;
   $('html, body').animate({ scrollTop: $('#videoItem').offset().top - _offset }, 'slow');
   return false;
 }

No HTML:

<div class="videoItem"  onclick="javascript:scrollTo();"></div>

Can anyone help me? Thank you.

    
asked by anonymous 01.07.2016 / 20:06

1 answer

1

You have named the function with the same name as a native Javascript function. Rename the function to work. View the MDN website

    
01.07.2016 / 20:26