Created
September 14, 2016 20:05
-
-
Save aarongustafson/3db151d511dd2520a7bd38f3d37c54f9 to your computer and use it in GitHub Desktop.
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 paginate( e ) { | |
// find the event target | |
var $target = e.target; | |
// if the target is a next or previous link… | |
if ( $target.matches( '.pagination .next, .pagination .prev' ) ) | |
{ | |
// handle pagination | |
} | |
} | |
// find the main element | |
var $main = document.querySelector('main'); | |
// watch for clicks and determine if we should paginate | |
$main.addEventListener( 'click', paginate, false ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment