문제

나는 창조에서 5 분 동안 세션을 죽이는 PHP 코드를 썼습니다.

페이지 모서리에 타이머를 표시하여 사용자에게 몇 분이 표시되는지 : 세션 시간이 끝날 때까지 몇 초가 걸립니다. 좋은 예가 있습니까?

도움이 되었습니까?

해결책

이 같은?http://keith-wood.name/countdown.html

여기에 사용 방법을 보여주는 간단한 예제가 있습니다.

var newYear = new Date(); 
newYear = new Date(newYear.getFullYear() + 1, 1 - 1, 1); 
$('#defaultCountdown').countdown({until: newYear}); 

이제 우리에게 필요한 것은 Unix 타임 스탬프 (세션이 끝날 때)입니다. 그런 다음 다음과 같이 수정할 수 있습니다.

var endOfSession = new Date(youtitmestamp * 1000); // timestamp is in seconds and we need miliseconds
$('#defaultCountdown').countdown({until: endOfSession}); 

도움이 되었기를 바랍니다!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top