Javascript 单击dissapearhtmldiv
为什么当我点击按钮时,状态会刷新,但按钮会显示 JS CSS HTML stats.phpJavascript 单击dissapearhtmldiv,javascript,jquery,html,css,Javascript,Jquery,Html,Css,为什么当我点击按钮时,状态会刷新,但按钮会显示 JS CSS HTML stats.php <?php include ("statsfunction.php"); ?><?php if( ( $Players = $Query->GetPlayers( ) ) !== false ): foreach( $Players as $Player ): ?>
<?php include ("statsfunction.php"); ?><?php if( ( $Players = $Query->GetPlayers( ) ) !== false ): foreach( $Players as $Player ): ?>
<img src="https://minotar.net/avatar/<?php echo htmlspecialchars( $Player ); ?>/32"><div class="playerinfo" id="<?php echo htmlspecialchars( $Player ); ?>"><?php echo htmlspecialchars( $Player ); ?></div></img>
<?php endforeach; else: ?>
No players
<?php endif; ?>
<p><b>Players <?php echo "<font color='green' ><?php $players_online ?></font>" ?> online</b></p>
<div class="col-sm-3 navplayers">
<?php include ("stats.php"); ?>
<div class="refreshstatus">Refresh</div>
</div>
好的,您的div.refreshstatus与加载的内容重叠。制作一个合适的按钮或使用链接
类似于
<div class="col-sm-3 navplayers">
<?php include ("stats.php"); ?>
<a href="#" class="refreshstatus">Refresh</a>
</div>
或者一个按钮
<div class="col-sm-3 navplayers">
<?php include ("stats.php"); ?>
<button type="button" class="refreshstatus">Refresh</button>
</div>
我猜按钮在status元素中?refreshstatus在NavPlayers中吗?你能为我们展示所有的HTML吗?心灵感应还没有完善:@misterManSam-但我他妈的马上就要把它做好了,现在任何一天。呵呵,我自己就知道了!我只需要将div.navPlayer放在一个单独的div中,如下所示:代码刷新可以工作,但最好使用or。。。特别是如果你想让它跨浏览器工作,尤其是那些不能很好地使用可点击浏览器的旧浏览器。强烈推荐!
<?php include ("statsfunction.php"); ?><?php if( ( $Players = $Query->GetPlayers( ) ) !== false ): foreach( $Players as $Player ): ?>
<img src="https://minotar.net/avatar/<?php echo htmlspecialchars( $Player ); ?>/32"><div class="playerinfo" id="<?php echo htmlspecialchars( $Player ); ?>"><?php echo htmlspecialchars( $Player ); ?></div></img>
<?php endforeach; else: ?>
No players
<?php endif; ?>
<p><b>Players <?php echo "<font color='green' ><?php $players_online ?></font>" ?> online</b></p>
<div class="col-sm-3 navplayers">
<?php include ("stats.php"); ?>
<div class="refreshstatus">Refresh</div>
</div>
<div class="col-sm-3 navplayers">
<?php include ("stats.php"); ?>
<a href="#" class="refreshstatus">Refresh</a>
</div>
<div class="col-sm-3 navplayers">
<?php include ("stats.php"); ?>
<button type="button" class="refreshstatus">Refresh</button>
</div>