相关疑难解决方法(0)

jQuery - multiple:not selector

我正在尝试定位不以'#'开头的页面范围的链接,并且不包括内联javascript但是我在确定如何正确构造选择器时遇到问题.

根据我用Google搜索的多个选择器,这应该有效,两个选择器都可以独立工作,而不是一起工作!

$('a:not([href*=javascript]), a:not([href^=#])')
.each(function(){...
Run Code Online (Sandbox Code Playgroud)

jquery jquery-selectors

75
推荐指数
3
解决办法
6万
查看次数

结合jQuery:not和:nth-​​child选择器

$j('.select-all-these:not(.except-these):nth-child(3n)');
Run Code Online (Sandbox Code Playgroud)

我正在尝试选择没有特定课程的每三个项目.这是我的jQuery选择器,但它不起作用 - 似乎:nth-​​child选择器忽略:not选择器.我做错了吗?

作为一个例子,这是它应该如何工作:

.select-all-these.except-these
.select-all-these.except-these
.select-all-these.except-these
.select-all-these
.select-all-these.except-these
.select-all-these
.select-all-these <-- THIS ONE IS SELECTED
.select-all-these.except-these
Run Code Online (Sandbox Code Playgroud)

谢谢!:)

jquery jquery-selectors

4
推荐指数
2
解决办法
6599
查看次数

标签 统计

jquery ×2

jquery-selectors ×2