javascript - Href scroll to page with offset -


how can make page scroll id using code below make pages croll want it, triggered on page load

$('html,body').animate({     scrolltop: $(id).offset().top - 64 }, 'slow'); 

on links clickable,

 href="page#a"  

is used. scrolls div not desire. there way can offset 64pixels on href? thanks

the id's css follows:

#a, #b {     margin-bottom: 64 px;     visibility: hidden;     position: absolute;     left: -999em; } 

       var top_val = $('.test');         $('html, body').stop().animate({             scrolltop: top_val.offset().top         }, 'slow'); 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -