Hopefully, by diving into the comments, you'll grasp the reasoning behind my actions :)
Outcome: http://jsfiddle.net/Tymek/8kvk91kz/
This is My HTML:
<head></head>
<body>
<article>
<header>…</header>
<section id="A">…</section>
<div class="wrap">
<div class="pan">
<section id="B">…</section>
<section id="B2">…</section>
</div>
</div>
<section id="C">…</section>
<footer>…</footer>
</article>
</body>
Here's the SCSS styling:
article.fixed {
position: fixed;
top: 0;
left: 0;
right: 0;
}
article {
section {
position: relative;
padding-bottom: 2em;
float: left;
width: 100%;
}
.wrap {
width: 100%;
overflow: hidden;
position: relative;
.pan {
width: 200%; /* <- Space for two sections here */
position: relative;
section {
width: 50%;
}
}
}
footer {
padding-bottom: 1em;
}
}
Lastly, let's delve into the 24 lines of jQuery-infused JavaScript:
$(document).ready(function(){
var h = $(window).height(),
pan = $(".pan").width()/2,
offset = Math.abs(h - $(".wrap").height()) / 2,
start = $(".wrap").offset().top - offset,
stop = start + pan;
$("body").css("height", $("body").height() + pan + "px");
$("article").addClass("fixed"); // Commandeering the Scroll
$(window).scroll(function(e){
var scroll = $(this).scrollTop();
if(scroll < start){ // Above horizontal section
$("article").css("margin-top", 0-scroll);
$(".pan").css("margin-left", 0);
} else {
if(scroll <= stop){ // Horizontally Scrolling
$("article").css("margin-top", 0-start);
$(".pan").css("margin-left", 0-scroll+start);
} else { // Below horizontal section
$("article").css("margin-top", 0-scroll+pan);
$(".pan").css("margin-left", 0-pan);
}
}
});
});
I fine-tuned the scrolling mechanism.