gpt4 book ai didi

javascript - 读取 然后在单击时加载弹出窗口

转载 作者:行者123 更新时间:2023-12-02 20:08:33 25 4
gpt4 key购买 nike

我想通过嵌入隐藏的 <td> 使表格行完全可点击包含如下链接:

<tr class="simplehighlight junk" >
<td>07/09/2011</td>
<td>Jennifer Woods Memorial GP</td>
<td>A52</td>
<td>Harris, Fred</td>
<td>1900</td>
<td>Nikolayev, Igor</td>
<td>2395</td>
<td class="text-center">0-1</td>
<td style='display:none;visibility:hidden;\'> games/game1242.php </td>
</tr>

我使用 colorbox 来定位表格单元格,如下所示:

<!--colorbox-->
<script src="./js/jquery.colorbox-min.js"></script>
<script>
$('tr.junk').colorbox(
{
iframe:true,
transition:'elastic',
speed:'100',
width:1030,
height:550,
href: function(){
return $(this).find('td').eq(8).text();
}
}
);
</script>

但是我想使用jquery:

<!--Another Pop-up for games table-->
<script src="./js/jquery.popupWindow-min.js" ></script>
<script>
$('.diagram-popup').popupWindow({centerBrowser:1, height:560, width:1024});
</script>

如何添加类(class) diagram-popup到第 8 个表数据单元格并让该行在单击时读取该单元格的内容?

最佳答案

<td class='diagram-popup' style='display:none;visibility:hidden;\'> games/game1242.php </td>

$(document).ready(function(){
$('.diagram-popup').click(function(){
$(this).html(); //contents of cell
});
});

这就是你要找的吗?

更新:啊,我明白了...您想要单击该行中的任何单元格,然后获取内容...也许这会有所帮助...

<td style='display:none;visibility:hidden;\'> games/game1242.php </td>

$(document).ready(function(){
$('table tr td').click(function(){
var cell = $(this).parent().find('td:last');
cell.addClass('diagram-popup'); //Not clear on if this is what you're wanting, you can always just print out the diagram-popup class server side
cell.html(); //contents of cell
});
});

我还没有测试过,但它应该可以工作。

关于javascript - 读取 <td> 然后在单击时加载弹出窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7196977/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com