jQuery内部PHP重复区域


jQuery inside PHP repeat region

我想在重复区域的行中创建一个jQuery工具提示

我做了,但是当重复区域发生时,jQuery只在第一行工作!

有人能帮忙吗?

<style type="text/css">
/* trigger button */
  #download_now {
    background:transparent url(/media/img/downloadnow.png) no-repeat scroll 0 0;
    display:block;
    height:44px;
    margin: 0 auto;
    margin-bottom:30px;
    overflow:hidden;
    text-indent:-999em;
    width:159px;
    cursor:pointer;
  }
  /* mouseover state */
  #download_now:hover {
    background-position:0 -44px;
  }
  /* clicked state */
  #download_now:focus {
    background-position:0 -88px;
  }
  /* tooltip styling */
  .tooltip {
    display:none;
    background:url(/media/img/tooltip/black_arrow_big.png);
    height:163px;
    padding:40px 30px 10px 30px;
    width:310px;
    font-size:11px;
    color:#fff;
  }
  /* a .label element inside tooltip */
  .tooltip .label {
    color:yellow;
    width:35px;
  }
  .tooltip a {
    color:#ad4;
    font-size:11px;
    font-weight:bold;
  }
</style>

<style type="text/css">
<!--
body {
    background-color: #884509;
}
-->
</style>
<center>
<table width="836" border="1">
  <tr bgcolor="#999900">
    <td width="16">&nbsp;</td>
    <td width="16">ID</td>
    <td width="85">EMAIL</td>
    <td width="85">USERNAME</td>
    <td width="115">E-CONFIRMED</td>
    <td width="200">WAITING PASSWORD</td>
    <td width="163">PASSWORD</td>
    <td width="104">ACTIVATE</td>
  </tr>
  <tr>
    <?php do { ?>
      <td height="26" bgcolor="#99FF00">
                                        <? include("../infos.html"); ?>
                                        <script src="http://cdn.jquerytools.org/1.2.7/full/jquery.tools.min.js"></script>
                                        <script language="javascript">
                                         $("#download_now").tooltip({ effect: 'slide'}).dynamic({ bottom: { direction: 'up', bounce: true } });
                                        </script>
      </td>
      <td bgcolor="#99FF00"><?php echo $row_Recordset1['id']; ?></td>
      <td bgcolor="#99FF00"><?php echo $row_Recordset1['email']; ?></td>
      <td bgcolor="#99FF00"><?php echo $row_Recordset1['nick']; ?></td>
      <td bgcolor="#99FF00"><?php echo $row_Recordset1['email_confirmation']; ?></td>
      <td bgcolor="#99FF00"><?php echo $row_Recordset1['waiting_pass']; ?></td>
      <td bgcolor="#99FF00"><?php echo $row_Recordset1['pass']; ?></td>
      <td bgcolor="#99FF00"><form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
        <table align="center">
          <tr valign="baseline">
            <td nowrap="nowrap" align="right">Pass:</td>
            <td><input type="text" name="pass" value="<?php echo htmlentities($row_Recordset1['waiting_pass'], ENT_COMPAT, ''); ?>" size="32" /><br>
              <input type="text" name="id" value="<?php echo htmlentities($row_Recordset1['id'], ENT_COMPAT, ''); ?>" size="32" /></td>
            </tr>
          <tr valign="baseline">
            <td nowrap="nowrap" align="right">&nbsp;</td>
            <td><input type="submit" value="Update record" /></td>
            </tr>
          </table>
        <input type="hidden" name="MM_update" value="form1" />
        <input type="hidden" name="id" value="<?php echo $row_Recordset1['id']; ?>" />
      </form>
      </td>
  </tr>
      <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</table>
</center>

这是上面的代码,请在本地主机上尝试检查问题。注意:我删除了记录集,如果你想让我把它包括进去,请告诉我。

如果你张贴了一些代码来显示导致问题的原因,可能会有所帮助,但一种猜测是,你可能会试图添加一个javascript对象的多个副本(jQuery工具提示),但使用相同的标识符为每个实例…如果是这样……将行号添加到工具提示id中,以使实例名称与行唯一。

你的调试控制台告诉你什么是错误的?还是Firebug ??