reworked pagify.js, jquery animations are now supported

This commit is contained in:
Chris Polis 2011-09-15 15:17:37 -07:00
parent 963327a411
commit 73766a769f
2 changed files with 9 additions and 1 deletions

View file

@ -10,6 +10,7 @@
$(document).ready(function() { $(document).ready(function() {
$('#page_holder').pagify({ $('#page_holder').pagify({
pages: ['about', 'usage', 'options'], pages: ['about', 'usage', 'options'],
animation: 'fadeIn',
default: 'about' default: 'about'
}); });
}); });

View file

@ -21,7 +21,14 @@
this.switchPage = function(page) { this.switchPage = function(page) {
page = page || window.location.hash.replace('#',''); page = page || window.location.hash.replace('#','');
$(self).load(page+'.html');
if(self.settings.cache) {
} else {
$.get(page+'.html', function(content) {
$(self).hide().html(content)[self.settings.animation]();
}, 'text');
}
} }
// Respond to hash changes // Respond to hash changes