Hello forum members i have a jquery problem. whenever i tried to apply on click scroll script i got this error “uncaught typeError: cannot read property ‘top’ of null”. Here following is code of Jquery.How can this will be fixed.
$(document).ready(function($){
$(‘a[href^=“#”]’).bind(‘click.smoothscroll’,function (e) {
e.preventDefault();
var target = this.hash,
$target = $(target);
$(‘html, body’).stop().animate({
‘scrollTop’: $target.offset().top
}, 900, ‘swing’, function () {
window.location.hash = target;
});
});
});