var url = $(location).attr(‘href’);
function scrollEvent(){
var url_sp = url.split(‘?anchorID=’);
var hash = ‘#’ + url_sp[url_sp.length – 1];
var tgt = $(hash);
var pos = tgt.offset().top;
$(‘html, body’).animate({scrollTop: pos}, 400, ‘swing’);
}
$(window).on(‘load’, function(){
if(url.indexOf(‘?anchorID=’) >= 0){
scrollEvent()
}
})