mousedown 이벤트로 var autorefresh를 지우고 싶지만 작동하지 않았습니다. 시작 간격 60초지우기 간격 자동 새로 고침
var auto_refresh = setInterval(function(){
$('#posts_db<?php echo $id ?>').load('data/posts_db.php');
}, 60000);
합니다 (commentarea에 대한) 1,800초에 간격을 변경하는 이는 MouseDown touchstart
// Comment_on Button wechselt von 60 sek auf 30 Min
$('#comment_on<?php echo $id ?>').bind('mousedown touchstart', function() {
$("#comment_on<?php echo $id ?>").stop().fadeOut("fast");
$("#comment_off<?php echo $id ?>").stop().delay(200).fadeIn("fast");
$("#element<?php echo $id ?>").stop().slideDown("slow");
clearInterval(auto_refresh);
// Intervall db load nach 1800 Sekunden während Eingabe
var auto_refresh = setInterval(
function()
{
$('#posts_db').load('data/posts_db.php');
}, 1800000);
});
이는 MouseDown touchstart은 변경
$(document).ready(function() {
$('#posts_db').load('data/posts_db.php');
});
준비 문서에
는로드 60 초 뒤로 간격 (사용자가 주석을 쓰지 않기로 결정한 경우)
// Wenn Kommentar Fenster geschlossen wird Intervall wieder auf 60 Sekunden
$('#comment_off<?php echo $id ?>').bind('mousedown touchstart', function() {
$("#comment_off<?php echo $id ?>").stop().fadeOut("fast");
$("#comment_on<?php echo $id ?>").stop().delay(200).fadeIn("fast");
$("#element<?php echo $id ?>").stop().slideUp("slow");
clearInterval(auto_refresh);
// Intervall db load nach 60 Sekunden
var auto_refresh = setInterval(
function()
{
$('#posts_db').load('data/posts_db.php');
}, 60000);
});
auto_refresh를 1800 초로 변경하지만 다시 60 초로 변경하면 작동하지 않습니다.
전역 적으로 또는 함수 외부에서 'var auto_refresh'를 초기화하십시오. –