A Pen by Peter Boomsma on CodePen.
Created
June 8, 2014 13:57
-
-
Save alucardu/e5f9f7acb3b42f02341a to your computer and use it in GitHub Desktop.
A Pen by Peter Boomsma.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#container-content | |
#content-top | |
#logo | |
%h1 | |
clean | |
%ul#menu | |
%li | |
%a{:href => "#", :id => "cleanpixel"}cleanPixel | |
%li | |
%a{:href => "#", :id => "projects"}projects | |
%li | |
%a{:href => "#", :id => "contact"}contact | |
#content-me | |
%p | |
Content me | |
#content-projets | |
%p | |
Content |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#cleanpixel").click(function (e) { | |
event.preventDefault(); | |
var container = $('#container-content'), | |
scrollTo = $('#content-me'); | |
container.animate({ | |
scrollTop: scrollTo.offset().top - container.offset().top + container.scrollTop() | |
}, 1500, function () {}); | |
}); | |
$("#projects").click(function (e) { | |
event.preventDefault(); | |
var container = $('#container-content'), | |
scrollTo = $('#content-projects'); | |
container.animate({ | |
scrollTop: scrollTo.offset().top - container.offset().top + container.scrollTop() | |
}, 1500, function () {}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body,html | |
height: 100% | |
#container-content | |
overflow: auto | |
height: 100% | |
#content-top | |
margin-bottom: 100% | |
#content-me | |
height: 100% | |
margin-bottom: 100% | |
#content-projects | |
height: 100% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment