1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 03:57:21 +00:00

Added scrollTo animation for navigation in TW5

This commit is contained in:
Jeremy Ruston 2011-12-28 16:10:03 +00:00
parent f381e95452
commit ed28773178

View File

@ -16,7 +16,11 @@ var StoryNavigator = function(navigators) {
StoryNavigator.prototype.navigateTo = function(title) {
var tiddlerHtml = this.navigators.store.renderTiddler("text/html","SimpleTemplate",title);
if(tiddlerHtml) {
$("<article/>").html(tiddlerHtml).appendTo("body");
var article = $("<article/>").html(tiddlerHtml);
article.appendTo("body");
$("html,body").animate({
scrollTop: article.offset().top
}, 400);
return false;
} else {
return true;