In this section we will add the code that will enable animated scrolling.
In another new file in your text editor, add the following code (it should go into a empty function which aliases the
$
character, the same as in the other examples):$("#content").empty(); var win = $(window), links = $("header nav a"), content = $("#content"), positions = {}, screensize = { width: win.width(), height: win.height() }, pages = $("<div></div>", { id: "pages" }).bind("contentLoaded", function() { var multiplier = Math.ceil(links.length / 2); $(this).appendTo(content).parent().addClass("full"); content.width(screensize.width * multiplier + screensize.width); content.height(screensize.height * multiplier); content.parent().find("header, footer").addClass("fixed").closest("body").css("padding-top", $("header").outerHeight()); links.add("footer nav a").click(function(e...