티스토리 뷰

<!-- 1. 준비중 : ~ 6/4 17:00까지 노출 -->
<a href="#n" class="js_pop_exam before" onclick="alert('6/4(화) 17:00 오픈 예정입니다.');return false;"></a>

<!-- 2. 진행중 : 6/4 17:00 ~ 6/14 23:59 -->
<a href="#n" class="js_pop_exam ongoing" target="_blank"></a>

<!-- 3. 종료 : 6/15 00:00 ~ -->
<a href="#n" class="js_pop_exam finish"></a>
// open : 2024-06-04 17:00
// close : 2024-06-15 00:00

$(() => {
    const textBefore = '6/4(화) 17:00 오픈 예정';
    const textOngoing = '결과 입력하기';
    const textFinish = '자세히 보기';

    const slideExam = $('.js_slide_exam'); // 슬라이드 배너
    const btnExam = $('.js_btn_exam'); // 슬라이드 배너 btn
    const popExam = $('.js_pop_exam'); // 팝업 배너

    // event 진행중 : 6/4 17:00 ~ 6/14 23:59
    <% If (fnDateTimeFormat(Now(), "YYYY-MM-DD") = "2024-06-04" And fnDateTimeFormat(Now(), "HH") >= "17") Or fnDateTimeFormat(Now(), "YYYY-MM-DD") > "2024-06-04" Then %>
        btnExam.text(textOngoing);
        slideExam.on('click', function() {
             window.open("event.asp", "_blank", "");
        })
        popExam.hide();
        $('.js_pop_exam.ongoing').show();

    // event 종료 : 6/15 00:00 ~
    <% Elseif ("2024-06-15" <= fnDateTimeFormat(Now(), "YYYY-MM-DD")) Then %>
        btnExam.text(textFinish);
        slideExam.on('click', function(){
            alert("이벤트가 종료되었습니다.");
            return false;
        })
        popExam.hide();
        $('.js_pop_exam.finish').show();

    // event 준비중 : ~ 6/4 17:00
    <% Else %>
        btnExam.text(textBefore);
        slideExam.on('click', function(){
            alert("6/4(화) 17:00 오픈 예정입니다.");
            return false;
        })
        popExam.hide();
        $('.js_pop_exam.before').show();
    <% End If %>
})
공지사항