How it's done #scrolling

Oscar Brito

I really like the UX in The scrolling experience on the different areas of the page it's really awesome for a one-page site.

Next, I will describe how they done the scrolling of the sub-areas:

1. Load and save all sub-pages positions:

function loadLocations() {
for(var i = 0; i < locations.length; i++){
locations[i] = Math.round($('#'+pages[i]).offset().top + 20); /(browserHeight * .02));/
locations[1] = browserHeight;

$(window).resize(function() {

2. onScroll updates page elements with bootstrap class's such as "clearfix fixed_subnav"

$(window).on("scroll",function () { 
currentScroll = Math.round($(window).scrollTop());

function scrollPosition(currentScroll){


else if (currentScroll > (locations[6] - navPadding - (navLinkHeight * 5))){
// numbers



Visit for more informations, contacts and news about Web Development.
See other blog posts at

Divhide purpose is to follow the HTML5 movement and contribute with applications which prove the quality of technology.

Feel free to contact divhide.