반응형
프로그레스바의 경우 그냥 제이쿼리 load함수로 작동하지 않는다.
그냥 value값만 변경해주면 된다.
이를 모르고 계속 시도하면서 시간낭비를 했다.
$("#div의 아이디").load(location.href+" #해당 div의 id>*","");
위 내용을 통해서 진행했다.
하지만, 결국 작동안되는 것을 알게되어 해당 기능을 구현하였다.
나의 경우 특정 값을 나눈 숫자를 뽑아와야 했는데,
$per = ($특정값->분자 / $특정값->분모) * 100;
echo number_format($per, 2);
위 처럼 해줘야해서 이를 어떻게 하나 고민하다가.
특정 태그를 만들어 해당 값을 저장하고 해당 값을 가져오는 방식으로 해결했다.
<body>
<div id='value'><?php echo 1123; ?></div>;
<div id="progress"></div>
</body>
setInterval(function () {
let vl = Number($("#value").text()); refresh된 값 가져오기
$("#value").load(location.href+" #value>*",""); 해당 값을 refresh 한다.
$('#progress').progressbar({ value: vl }); 값 넣기
}, 5000);
// 물론 아래에 초기에 호출되는 것을 구현해야한다.
$(function() {
$('#progress').progressbar({
value: 13,
max: 100
});
});
이렇게 했더니 프로그레스바 진행이 잘 되더라...
몇시간 낭비한거야 -_-
아래 코드로는 죽어도 안되더라.
jQuery progress bar disappears after using .load()
jQuery progress bar disappears after using .load()
I've added progress bars to my site and they work perfectly when the page loads. However, I want to reload the div using jQuery .load() and after the div has reloaded the progress bars disappear but
stackoverflow.com
728x90
'취업 > PHP' 카테고리의 다른 글
the content must be served over HTTPS. (1) | 2021.06.25 |
---|---|
[JS]IOS 카운트다운(getTimeRemaining) NaN출력 문제 (0) | 2021.06.25 |
[PHP] input 창 .(dot)입력 방지 및 숫자만 입력하기. (0) | 2021.06.22 |
[php] 특정 영역(div) 깜박임 없는 새로고침 (1) | 2021.06.21 |
[php]Jquery ui tab 새로고침해도 select tab 유지 (0) | 2021.06.21 |