1
나는 GwtQuery 사용을하기로 결정했습니다GwtQuery은 - 빈() 위젯 페이드 아웃() 후 GWT에 부트 스트랩 경고/알림 라이브러리를 포장에 내 좌절의
는public static void showErrorNotification(String message){
List<Widget> allNotifications = $(".notification").widgets();
for (Widget w : allNotifications){
$(w).fadeIn(1000);
$(w).append("<div id=\"errorAlert\" class=\"rounded10 errorAlert\">" +
"<img alt=\"\" src=\"public/images/exclamation.png\"> " +
"You must accept the terms and conditions to finish your registration." +
"</div>");
$(w).fadeOut(5000);
//$(w).empty();
}
}
이 코드의 문제는이다 ,이 메소드는 사용자가 여러 번 호출 할 수 있으므로 시간이 지남에 따라 HTML이 누적됩니다. 주석 처리 된 행에서와 같이 비어 있으면 알림이 표시되지 않습니다.
해결책이 될 수 있으므로 페이드 아웃 한 후에 알림 패널이 비워집니다.
업데이트 :
내가 넣어:
$(w).empty(
) 아무것도 fadeIn()
전에이 메소드가 불려 두 번째 시간을 보여줍니다.