2013-03-17 83 views
-1

我想打一個行內一個jQuery提示在重複區域
jQuery的PHP重複區域

我造的,但是裏面當重複區域發生,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> 

這是上面的代碼,請在本地主機上試一下以檢查問題。 注:我刪除了記錄集,如果你想讓我包含它,告訴我。

+0

沒有一些相關的代碼我們不能真正幫助你。 – 2013-03-17 12:56:03

+0

你可以顯示你到目前爲止的代碼嗎? – 2013-03-17 12:56:04

+0

好吧給我一秒.. – 2013-03-17 12:57:04

回答

1

這可能幫助,如果您發佈了一些代碼來顯示是什麼原因造成的問題,而是一個猜測是,你可能會嘗試添加JavaScript對象(jQuery的工具提示)的多個副本,但使用相同的IDENTIFER每個實例...如果是這樣......將行號添加到工具提示ID以使實例名稱對於該行唯一。

您的調試控制檯告訴您的錯誤是什麼?或Firebug?也許你可以發佈任何錯誤消息。

+0

沒有錯誤消息,但工具提示僅在第一行中起作用。 我會嘗試你所說的話,我會回來..謝謝 – 2013-03-17 13:04:15

+0

剛剛看到的代碼...我不知道jQuery ..但我敢打賭,下載的降壓 - 現在是工具提示ID ...你不能有多個具有相同ID的dom節點。如果你只想要一個工具提示(你的CSS似乎建議),那麼你需要在循環外實例化它,然後在每一行上觸發它... – Radiotrib 2013-03-17 13:05:33

+0

我將它改爲: '' – 2013-03-17 13:08:23