是否可以在 Wicket 中进行平滑的页面导航转换?

我想在 Wicket Java 框架中的页面导航之间进行一些平滑的转换。是否可以使用 Wicket 工具、javascript 和 css?我找不到办法做到这一点。

感谢您的任何答复。



慕莱坞森
浏览 58回答 1
1回答

泛舟湖上清波郎朗

Wicket 不为此提供解决方案。大多数 Wicket 应用程序使用全页重新提醒/重定向或 Ajax 来仅更新页面的一部分,而不是整个页面。我建议您尝试使用 CSS 关键帧。这个想法是在这两个 JS 事件上将 CSS 类添加到页面正文:beforeunload和DOMContentLoaded(又名domready)。当beforeunload被触发时,您需要删除fade-in并添加fade-outCSS 类。并对 执行相反的操作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 询问更多信息。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java