테스트 사이트 - 개발 중인 베타 버전입니다

로딩중 효과가 왜 이럴까요ㅠㅠ 채택완료

고기조아 2년 전 조회 1,888

구글링해서 페이지 로딩중 표시하려고 하는데,

페이지가 로딩이 다 끝났는데도 계속 로딩 이미지가 떠 있습니다.

</p>

<p><html>

<head>

<meta charset="UTF-8" />

<script src="<a href="http://code.jquery.com/jquery-latest.min.js"></script>" target="_blank" rel="noopener noreferrer">http://code.jquery.com/jquery-latest.min.js"></script></a>

 

<style>

    #loading {

        width: 100%;

        height: 100%;

        top: 0;

        left: 0;

        position: fixed;

        display: block;

        opacity: 0.5;

        background: #ffffff;

        z-index: 100;

        text-align: center;

    }

 

    #loading img {

        position: absolute;

        top: 50%;

        left: 50%;

        transform: translate(-50%, -50%);

        z-index: 101;

    }

</style>

</head>

<body>

<div id="loading">

    <img src="<?php echo G5_THEME_URL;?>/img/hourglass.gif" alt="loading">

</div></p>

<p><div class="container">

    <form method="post" id="test" action="test.php">

    <div>

      <textarea id="answer" name="answer" style="width:500px;height:450px;"><?=$answer;?></textarea>

    </div>

    <div>

      <textarea id="question" name="question" style="width:500px;height:80px;"><?=$question; ?></textarea>

    </div>

      <input type="submit" value="전송">

    </form>

<div>

<script>

    $(window).load(function () {

        $('#loading').hide();

    });

</script>

</body>

</html></p>

<p>

댓글을 작성하려면 로그인이 필요합니다.

답변 3개

채택된 답변
+20 포인트

테스트 해보니 잘 되네요.

알려주신 소스 문제는 아닌 듯 합니다.

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

해당 로드 스크립트 이전에 다른 스크립트 오류가 있을 가능성이 있습니다.

f12 누르셔서 콘솔탭의 오류메시지를 확인해보세요.

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

세크티
2년 전

아래 코드로 해보세요

</p>

<pre>
<script>
    window.addEventListener("load", function(event) {
        document.getElementById("loading").remove()
    });
</script></pre>

<p>

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인