Added scrollTo animation for navigation in TW5

print-window-tiddler
Jeremy Ruston 2011-12-28 16:10:03 +00:00
rodzic f381e95452
commit ed28773178
1 zmienionych plików z 5 dodań i 1 usunięć

Wyświetl plik

@ -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;