2013-09-20 03:20
浏览 42

Bootstrap popover不在while循环中工作

I'm trying to use the popover element from bootstrap's framework for Javascript/jQuery and it only works with the first one in the while loop. How can I make it work for all of them?

Why is this? Been trying to figure this out for a bit...

require 'include.php';

    $selectBets = $dbc->query("SELECT * FROM `bets` ORDER BY `bid` DESC LIMIT 10");
<style type="text/css">
#hash_text {
    font-size: 3.8px;
<table class="table table-striped table-bordered table-hover">
                    <th>Bet Number</th>
                    <th>Send Address</th>
                    <th>Time Created</th>
                    <th>Time Expires</th>
                    <th>Chance to Win</th>
                    <th>Payout Multiplier</th>
                    <th>Final Profit</th>
                    <th>Server Hash</th>
                <?php while($BetsArray = $selectBets->fetch()) { ?>
                  <td><?php echo $BetsArray['bid']; ?></td> 
                  <td><?php echo $BetsArray['amount']; ?></td> 
                  <td><?php echo $BetsArray['deposit_address']; ?></td> 
                  <td><?php echo date('m/d/Y - H:i:s', $BetsArray['time_created']); ?></td> 
                  <td><?php echo date('m/d/Y - H:i:s', $BetsArray['time_expires']); ?></td> 
                  <td><?php echo $BetsArray['win_chance']; ?></td> 
                  <td><?php echo $BetsArray['multiplier']; ?></td> 
                  <td><?php echo $BetsArray['profit']; ?></td> 
                  <td><a id="hash" data-container="body" data-toggle="popover" data-placement="right">Click here for Server Hash</a></td>
                <?php } ?>
              <script type="text/javascript">
              $(function() {
                    html: true,
                    placement: 'right',
                    content: '<?php echo '<span id="hash_text">' . hash('sha512', $BetsArray['number'] . '-' . $_SESSION['client_seed']) . '</span>'; ?>'

1条回答 默认 最新

相关推荐 更多相似问题