I have this anchor link from Page A, abc.com/news#section2
In news page, the header blocks the top part of the section 2. I tried to offset it in jquery but it doesn't work. Hope someone can help, thanks in advance!
jQuery('.ch-item a').click(function(e) {
var link = jQuery(this);
var target = jQuery(link.attr('href').substring(link.attr('href').indexOf('#')));
if(target.length > 0) {
jQuery('html, body').stop().animate({scrollTop: target.offset().top - jQuery('.header_container').outerHeight()}, 1000);
e.preventDefault();
} else if(options.preventNonLink) {
e.preventDefault();
}
});``