是否可以在 Wicket 中进行平滑的页面导航转换?
Is it possible to make smooth page navigation transitions in Wicket?
我想在 Wicket Java 框架中的页面导航之间进行一些平滑过渡。可以使用 Wicket 工具 javascript 和 css 吗?我找不到办法做到这一点。
感谢您的回答。
Wicket 没有为此提供解决方案。大多数 Wicket 应用程序使用整页 re-remder/redirect 或 Ajax 来更新页面的一部分,而不是整个页面。
我建议您尝试使用 CSS 关键帧。这个想法是将 CSS class 添加到这两个 JS 事件的页面主体:beforeunload
和 DOMContentLoaded
(又名 domready
)。当 beforeunload
被解雇时,您需要删除 fade-in
并添加 fade-out
CSS class。对 DOMContentLoaded
.
执行相反的操作
CSS 看起来像:
/* make keyframes that tell the start state and the end state of our object */
@-webkit-keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@-moz-keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
.fade-in {
opacity:0; /* make things invisible upon start */
-webkit-animation:fadeIn ease-in 1; /* call our keyframe named fadeIn, use animattion ease-in and repeat it only 1 time */
-moz-animation:fadeIn ease-in 1;
animation:fadeIn ease-in 1;
-webkit-animation-fill-mode:forwards; /* this makes sure that after animation is done we remain at the last keyframe value (opacity: 1)*/
-moz-animation-fill-mode:forwards;
animation-fill-mode:forwards;
-webkit-animation-duration:1s;
-moz-animation-duration:1s;
animation-duration:1s;
}
我在 CSS 方面不是很好,所以最好向 Google 询问更多信息。
我想在 Wicket Java 框架中的页面导航之间进行一些平滑过渡。可以使用 Wicket 工具 javascript 和 css 吗?我找不到办法做到这一点。
感谢您的回答。
Wicket 没有为此提供解决方案。大多数 Wicket 应用程序使用整页 re-remder/redirect 或 Ajax 来更新页面的一部分,而不是整个页面。
我建议您尝试使用 CSS 关键帧。这个想法是将 CSS class 添加到这两个 JS 事件的页面主体:beforeunload
和 DOMContentLoaded
(又名 domready
)。当 beforeunload
被解雇时,您需要删除 fade-in
并添加 fade-out
CSS class。对 DOMContentLoaded
.
CSS 看起来像:
/* make keyframes that tell the start state and the end state of our object */
@-webkit-keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@-moz-keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
.fade-in {
opacity:0; /* make things invisible upon start */
-webkit-animation:fadeIn ease-in 1; /* call our keyframe named fadeIn, use animattion ease-in and repeat it only 1 time */
-moz-animation:fadeIn ease-in 1;
animation:fadeIn ease-in 1;
-webkit-animation-fill-mode:forwards; /* this makes sure that after animation is done we remain at the last keyframe value (opacity: 1)*/
-moz-animation-fill-mode:forwards;
animation-fill-mode:forwards;
-webkit-animation-duration:1s;
-moz-animation-duration:1s;
animation-duration:1s;
}
我在 CSS 方面不是很好,所以最好向 Google 询问更多信息。