Simple example using waypoint.js
Created
December 22, 2014 06:04
-
-
Save ezos86/370a227dca933d310d53 to your computer and use it in GitHub Desktop.
Waypoints Example
This file contains hidden or 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
<section id="sec-1"></section> | |
<nav></nav> | |
<section id="sec-1"></section> |
This file contains hidden or 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
$(function() { // When the page has loaded, | |
$('nav').waypoint( // create a waypoint | |
function() { | |
alert("Waypoint reached."); | |
} | |
) | |
}); |
This file contains hidden or 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
#sec-1{ | |
height:1000px; | |
background-color:#f1f1f1; | |
} | |
nav{ | |
background-color:red; | |
height:30px; | |
width:100%; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment