이미지가로드되는 동안 회 전자를 표시 한 다음 완료되면 이미지를 표시하는 코드입니다. 또한이 페이지는 매 5 초마다 자동 새로 고침이 필요하며 새로 고침은 11 초에 중단되어야합니다 (즉, 두 번 새로 고침하십시오). 그러나 이것은 효과가 없습니다. 회 전자 코드는 CSS 파일에 있습니다. 이것은 작동하지 않습니다. 계속해서 새로 고침을하십시오. 타임 아웃이 재설정되고, var를 사용하여 기쁨을 얻지 않으려 고 시도했습니다. 어떤 도움이 높게 평가되었습니다.페이지 새로 고침 중지 - 지우기 기능을 사용하지 않음
<META HTTP-EQUIV="Cache-Control" CONTENT="max-age=0">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META http-equiv="expires" content="0">
<META HTTP-EQUIV="Expires" CONTENT="Tue, 01 Jan 1980 1:00:00 GMT">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<html>
<head>
<link rel="stylesheet" href="/css/graph.css" type="text/css" media="screen, projection">
<script src="/javascript/jquery-latest.js" type="text/javascript">
</script>
<script type="text/javascript">
var img = new Image(); img.height=600; img.width=2000;
$(img).load(function() {
$(this).css('display','none');
$(this).animate({ opacity: 0.25 }).fadeIn("slow");
$('#loader').append(this);
$(this).animate({ opacity: 1 })
}).error(function() {
}).attr('src', 'xyz.png');
var timer = function() { window.location.reload(true);};
window["reload_timer"] = setTimeout(timer, 5000);
var timer2 = function() {
clearTimeout(window["reload_timer"]);
clearTimeout(window["reload_timer2"]);};
window["reload_timer2"] = setTimeout(timer2, 11000);
</script>
</head>
<body id = "page"><div id="loader" class="loading">
</div>
</body>
</html>
잘 도달하지 않도록 이미, 다시로드 잊고, 당신은 ** ** 페이지를 다시로드하는 ... – leppie
당신은 정말해야합니까 페이지를 새로 고침하거나 의도적으로 이미지를 두 번 다시로드 하시겠습니까? –
이미지도 할 것입니다 ... 작동하는 경우 ...이 코드는 기본 창의 iframe에 들어갈 것이기 때문에 iframe에서 reload()를 시도했지만 거기에서 같은 문제가 발생합니다 clearTimeout은 호출되지 않거나 재설정을 계속합니다. 타이머는 매번 재 장전 할 때마다. –