0
在我的PHP我有這樣的:這個旋鈕沒有更新,我不知道爲什麼
<?php
@include_once('fields.php');
$gg = fetchinfo("val","inf","n","current");
$mm = fetchinfo("val","info","n","max");
$cc = fetchinfo("num","games","id",$gg);
$percent = $cc/$mm *100;
echo'<input class="knob" id="progress-circle" data-fgcolor="#f15700" data-bgcolor="rgba(23,28,34,0.8)" data-min="'.$cc.'" data-max="'.$mm.'" data-thickness=".2" readonly="readonly" value="'.$cc.'" data-width="18%" style="width: 142px; height: 92px; position: absolute; vertical-align: middle; margin-top: 92px; margin-left: -209px; border: 0px; font-style: normal; font-variant: normal; font-weight: bold; font-stretch: normal; font-size: 69px; line-height: normal; font-family: Arial; text-align: center; color: rgb(241, 87, 0); padding: 0px; -webkit-appearance: none; background: none;">';
?>
,我有一個js文件是我想刷新和更改velue當它與這改變代碼:
refresh();
function refresh()
{
$.ajax({
type: "GET",
url: "pro.php",
error: function(err) {
console.log(err);
},
success: function(result) {
$("#progress-circle").val(result).trigger('change');
}
});
setTimeout(refresh, 1000);
}
但是當值變化時,不要在我的HTML改變,所以只有當我刷新頁面更新。
請登錄什麼'result'實際上包含。它可能根本不會返回您認爲應該返回的內容。除此之外,代碼似乎工作正常。 – Sumurai8
另一個說明:爲什麼您將樣式包含在標籤本身中,而不是通過樣式表? – Sumurai8
https://jsfiddle.net/37z7fmz5/ – Sumurai8