$().css() 的 jQuery 代码解释
$(".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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
此代码将“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.
让我们从简单的部分开始:
这表示对象将使用“手”光标;
这是将要设置样式的对象。
据我所知,您有一个类为“.GV”的对象,并且打算将光标添加到名为“<%=GridView1.ClientID%>”的 ID只要它的 tr (表行)没有 th (表头)...
let's start with the easy part:
This says the object will use the "hand" cursor;
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)...
首先找到类为“
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 IdGridView1
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.将光标设置为指向该 gridview 的指针,指向表中
内没有
的所有 td
set the cursor as pointer to that gridview to all td's in a table which have no
<th>
inside<tr>
首先,正如帕斯卡所说,请不要在SF上大喊大叫。
如此
选择器也是 。不具有任何表或标题作为后代且也是
.GV#<%=GridView1.ClientID%>
子级的表行,
.GV
是一个类,#<%=GridView1.ClientID%>
是在 ASP 中生成的 id。将 css 属性“cursor”设置为“pointer”。
First of all, as Pascal said, please don't shout on SF.
So,
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.sets the css property "cursor" to "pointer".