如果擷取迴圈內的值
問題:如何在需要彈出的DIV中顯示、迴圈中的值呢?
比如我$records 數組中還有$records["qq"] 如何當使用者點擊這個tr的時候、自動將這個tr裡$records["qq"]的值傳到彈出的div裡面
JScript code
function popUserDetail(x){ var popUp = document.getElementById("popUserDetail"); var h = (x.rowIndex)*20; popUp.style.top= 25 + h + "px"; popUp.style.left="142px"; popUp.style.width="200px"; popUp.style.height="100px"; popUp.style.visibility="visible"; }
PHP code
while ($records = mysql_fetch_array($rows)) { $arr = ct($records['uniqueid']); $fileLastUploadTime = $arr[1]; print ' '.st($records['lastT'],$fileLastUploadTime).' '.$records['barName'].' '.$records['lastLogin'].' '.date("Y-m-d H:i:s",$arr[1]).' '.$records['endTM'].' '.$arr[0].' '.$records['version'].' '; } print ' d ';print ' 首頁| 上一頁| 下一頁| 尾頁
'.$total.'條記錄 當前第'.$pageId.'頁 共'.$pageCount.'頁 ';
------解決方案--------------------
print '
設一個id
print '...聯絡QQ:';
然後Js函數裡
function popUserDetail(x, qq){
var popUp = document.getElementById("popUserDetail");
var h = (x.rowIndex)*20;
popUp.getElementById('qq').innerText = qq;
popUp.style.top= 25 + h + "px";
popUp.style.left="142px";
popUp.style.width="200px";
popUp.style.height="100px";
popUp.style.visibility="visible";
}
是這個意思?還是我曲解你的想法了
------解決方案--------------------