我希望你们中的一个人可能会就我在使用 jquery auto_refresh 函数时遇到的问题指出正确的方向 - 下面的代码 - > 嗯,它刷新了一切,但遗憾的是它看起来很难看。Oo 当刷新发生时,它会不成比例地闪烁。显然必须有一个更顺畅的方式来做到这一点......
<script>
var auto_refresh = setInterval(
function ()
{
$('#basic').load('resources_basic.php');
}, 1000);
$(function() {
$( "#draggable_res" ).draggable();
});
</script>
<div id="draggable_res" class="ui-widget-content">
<h5> Resources </h5>
<div id="Accordion1" class="Accordion" tabindex="0">
<div class="AccordionPanel">
<div class="AccordionPanelTab">Basic Resources</div>
<div class="AccordionPanelContent">
<div id="basic"><?php include 'resources_basic.php'; ?></div>
</div>
</div>
<table width="160" border="2" cellspacing="2" cellpadding="2">
<tr>
<td width="30"><img src="images/product/gold.gif" width="30" height="30" alt="Gold" /></td>
<td width="110"><?php echo $row_resourcesbasic_rs['gold']; ?></td>
</tr>
<tr>
<td width="30"><img src="images/product/wood.gif" width="30" height="30" alt="Wood" /></td>
<td width="110"><?php echo $row_resourcesbasic_rs['wood']; ?></td>
</tr>
<tr>
<td width="30"><img src="images/product/clay.gif" width="30" height="30" alt="Clay" /></td>
<td width="110"><?php echo $row_resourcesbasic_rs['clay']; ?></td>
</tr>
<tr>
<td width="30"><img src="images/product/stone.gif" width="30" height="30" alt="Stone" /></td>
<td width="110"><?php echo $row_resourcesbasic_rs['stone']; ?></td>
</tr>
</table>
提前致谢 :)