jQuery find / is(':visible') 问题
请参阅此处的代码:
由于某种原因,无论它是否可见,它总是在 .is(':visible') 上返回 false。
有什么理由吗?我应该做些什么不同的事情吗?
Please see the code here:
For some reason, it always returns false on the .is(':visible') whether or not it is visible.
Any reason why? Anything I should be doing differently?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要使用:
spanselect
是一个id
,而不是class
。顺便说一下,
$("#holder span#spanselect")
的工作原理是一样的。作为记录,您可以将is(":visible")
更改为length
并看到它等于0
,并轻松查看选择器失败。示例: http://jsfiddle.net/kobi/wQpTu/5/
You need to use:
spanselect
is anid
, not aclass
.$("#holder span#spanselect")
would work just the same, by the way. For the record, you can changedis(":visible")
tolength
ans saw it was equal to0
, and easily see the selector fails.Example: http://jsfiddle.net/kobi/wQpTu/5/
您正在使用“.”而不是“#”。 这将起作用:
You are using "." instead of "#". This will work: