1 回答

TA貢獻(xiàn)1818條經(jīng)驗(yàn) 獲得超3個(gè)贊
Wicket 不為此提供解決方案。大多數(shù) Wicket 應(yīng)用程序使用全頁(yè)重新提醒/重定向或 Ajax 來僅更新頁(yè)面的一部分,而不是整個(gè)頁(yè)面。
我建議您嘗試使用 CSS 關(guān)鍵幀。這個(gè)想法是在這兩個(gè) JS 事件上將 CSS 類添加到頁(yè)面正文:beforeunload和DOMContentLoaded(又名domready)。當(dāng)beforeunload被觸發(fā)時(shí),您需要?jiǎng)h除fade-in并添加fade-outCSS 類。并對(duì) 執(zhí)行相反的操作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;
}
我不太擅長(zhǎng) CSS,所以最好向 Google 詢問更多信息。
添加回答
舉報(bào)