私はこのライブラリを使用しました:
css3トランジットはデフォルトよりもはるかに高速です
entry.jsを変更します(おそらくあなたに適応する必要がありますが、これは私にとってはうまくいきました)
define(['../system'], function(system) {
var fadeOutDuration = 100;
var entrance = function(parent, newChild, settings) {
return system.defer(function(dfd) {
function endTransition() {
dfd.resolve();
}
function scrollIfNeeded() {
if (!settings.keepScrollPosition) {
$(document).scrollTop(0);
}
}
if (!newChild) {
scrollIfNeeded();
if (settings.activeView) {
$(settings.activeView).transition({
opacity: 1,
scale: 0.3,
duration: duration,
easing: 'in',
complete: function(){
$(settings.activeView).css('display' ,'none');
if (!settings.cacheViews) {
ko.virtualElements.emptyNode(parent);
}
endTransition();
}
});
} else {
if (!settings.cacheViews) {
ko.virtualElements.emptyNode(parent);
}
endTransition();
}
} else {
var $previousView = $(settings.activeView);
var duration = settings.duration || 500;
function startTransition() {
scrollIfNeeded();
if (settings.cacheViews) {
if (settings.composingNewView) {
ko.virtualElements.prepend(parent, newChild);
}
} else {
ko.virtualElements.emptyNode(parent);
ko.virtualElements.prepend(parent, newChild);
}
var startValues = {
//marginLeft: '90%',
//marginRight: '-20px',
opacity: 0,
scale: 0.3,
display: 'block'
};
var endValues = {
//marginRight: 0,
//marginLeft: 0,
opacity: 1,
scale: 1
};
$(newChild).page();
$(newChild).trigger('create');
$(newChild).css(startValues);
$(newChild).transition(
{
marginRight: 0,
marginLeft: 0,
opacity: 1,
scale: 1,
duration: duration,
easing: 'in',
complete: endTransition
});
//startValues,500, 'ease');
//$(newChild).transition(endValues, duration, 'swing', endTransition);
//$(newChild).transition({ opacity: 0.1, scale: 0.3 }, 500, 'in', function() {..});
//endTransition();
}
if ($previousView.length) {
$previousView.transition({
opacity: 0,
scale: 0.3,
duration: 500,
easing: 'in',
complete: function(){
$previousView.css('display' ,'none');
startTransition();
}
});
//$('.news').css('display','none');
//$previousView.fadeOut(fadeOutDuration, startTransition);
} else {
startTransition();
}
}
}).promise();
};
return entrance;
});
私の悪い英語でごめんなさい。