简体   繁体   English

JQuery 仅在第一次显示时显示<td>被点击

[英]JQuery show only when first <td> is clicked

I've pieced together some stuff to make this work, it does exactly what I want it to do, however I only want the rows below the parent to show when the #parentClick (date) is clicked and not the rest of the <td> in the parent row is clicked.我拼凑了一些东西来完成这项工作,它完全符合我的要求,但是我只希望在单击 #parentClick(日期)时显示父级下方的行,而不是<td>的其余部分<td>单击父行。 The idea is that all the numbers that are here will hyperlink over to another page, including the roll up ones in the parent.这个想法是这里的所有数字都将超链接到另一个页面,包括父页面中的汇总数字。

JSFiddle JSFiddle

Just check to see if the original clicked element is the trigger element using只需检查原始点击元素是否是使用触发元素

var originalElement = e.target;
if($(originalElement).attr('id') == 'parentClick'){
}

Updated fiddle: https://jsfiddle.net/czxhvn1r/3/更新小提琴: https : //jsfiddle.net/czxhvn1r/3/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM