Created
March 3, 2009 17:28
-
-
Save jonathanpenn/73411 to your computer and use it in GitHub Desktop.
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
Some ideas for unobtrusive ajax pagination. | |
HTML Markup... | |
<div class="pagination_container"> | |
<div class="pagination> | |
<a href="...">1</a>... | |
</div> | |
<div class="pagination_target"> | |
<p>Blah, blah</p> | |
... | |
</div> | |
</div> | |
jQuery Behavior | |
$(".pagination_container .pagination a").live("click", function(click_event) { | |
click_event.preventDefault(); | |
var target = $(this).closest(".pagination_container").find(".pagination_target"); | |
var href = $(this).attr("href"); | |
target.load(href); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment