$().css() 的 jQuery 代码解释

发布于 2024-10-20 10:29:55 字数 145 浏览 3 评论 0原文

$(".GV#<%=GridView1.ClientID%>  >  tr:not(:has (table, th) )").css("cursor","pointer")

有人可以向我解释一下这段代码吗?

$(".GV#<%=GridView1.ClientID%>  >  tr:not(:has (table, th) )").css("cursor","pointer")

Can someone please explain this code to me?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

风吹雪碎 2024-10-27 10:29:55

此代码将“cursor:pointer”应用于不包含表头 (th) 或其他表的特定 ASP.NET 网格视图 (<%= GridView1.ClientID %>) 的所有表行 (tr)。

因此,鼠标光标将看起来像一只手,从而暗示用户可以单击表格行。

This code applies "cursor:pointer" to all table rows (tr) of a particular ASP.NET grid view (<%= GridView1.ClientID %>) which don't contain a table header (th) or another table.

As a result the mouse cursor will look like a hand thus implying that the user can click the table rows.

み零 2024-10-27 10:29:55

让我们从简单的部分开始:

css("cursor","pointer")

这表示对象将使用“手”光标;

$(".GV#<%=GridView1.ClientID%>  >  tr:not(:has (table, th) )")

这是将要设置样式的对象。

据我所知,您有一个类为“.GV”的对象,并且打算将光标添加到名为“<%=GridView1.ClientID%>”的 ID只要它的 tr (表行)没有 th (表头)...

let's start with the easy part:

css("cursor","pointer")

This says the object will use the "hand" cursor;

$(".GV#<%=GridView1.ClientID%>  >  tr:not(:has (table, th) )")

This is the object that will be styled.

From what I gather, you have an object with a class ".GV", and intend to add the cursor to the ID named "<%=GridView1.ClientID%>" as long as its tr (table row) doesn't have a th (table header)...

瑶笙 2024-10-27 10:29:55

首先找到类为“GV”的元素,然后在其中查找 Id 为 GridView1 的元素
最后一部分确保您不会获取表头

最后一部分 .css("cursor","pointer") 将指针光标添加到 css。

first you find the element with the class "GV" then you look for an element within that, with the Id GridView1
the last part makes sure you do not get the table header

the last part .css("cursor","pointer") adds a pointer curser to the css.

甜是你 2024-10-27 10:29:55

将光标设置为指向该 gridview 的指针,指向表中 内没有 的所有 td

set the cursor as pointer to that gridview to all td's in a table which have no <th> inside <tr>

青巷忧颜 2024-10-27 10:29:55

首先,正如帕斯卡所说,请不要在SF上大喊大叫。

如此

$(".GV#<%=GridView1.ClientID%>  >  tr:not(:has (table, th) )")

选择器也是 。不具有任何表或标题作为后代且也是 .GV#<%=GridView1.ClientID%> 子级的表行 .GV 是一个类,#<%=GridView1.ClientID%> 是在 ASP 中生成的 id。

.css("cursor","pointer")

将 css 属性“cursor”设置为“pointer”。

First of all, as Pascal said, please don't shout on SF.

So,

$(".GV#<%=GridView1.ClientID%>  >  tr:not(:has (table, th) )")

is the selector. The table rows <tr> that do not have any tables or headers as descendents and are also children to .GV#<%=GridView1.ClientID%>, .GV being a class and #<%=GridView1.ClientID%> an id generated in ASP.

.css("cursor","pointer")

sets the css property "cursor" to "pointer".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文