code left out of last commit

This commit is contained in:
Chris Polis 2011-09-29 21:42:35 -07:00
parent 765dee9459
commit 9bc21c5f78

View file

@ -15,6 +15,7 @@
pages: [],
default: null,
animation: 'show',
onChange: function (page) {},
cache: false
};
this.settings = $.extend({}, this.defaults, options);
@ -31,11 +32,13 @@
// Load page content from cache
if(self.settings.cache) {
$(self).hide().html(self.pages[page])[self.settings.animation]();
self.settings.onChange(page);
// Fetch page content
} else {
$.get(page+'.html', function(content) {
$(self).hide().html(content)[self.settings.animation]();
self.settings.onChange(page);
}, 'text');
}
}