在 Cufon 中使用 jquery not() 选择器

发布于 2024-11-19 00:03:26 字数 313 浏览 4 评论 0原文

我正在使用 Cufon 替换导航中的一些列表项。 div 元素(位于列表项内)内有一些我不想替换的内容。我希望这会起作用......

Cufon.replace('li:not("li div")');

但事实并非如此。

我意识到,如果排除适用于兄弟姐妹,我可以使用类似...

Cufon.replace('li:not(li.dontreplace)');

但我想排除一个 div,它是 LI 的孩子,

有人可以帮忙吗?

干杯

I am using Cufon to replace some list items in a nav. There is some content inside a div element (which is inside the list item) that I dont want replaced. I was hoping this would work...

Cufon.replace('li:not("li div")');

But it doesn't.

I realize that if the exclusion applied to a sibling I could use something like...

Cufon.replace('li:not(li.dontreplace)');

But i want to exclude a div which is a CHILD of the LI

Can someone help please?

cheers

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

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

发布评论

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

评论(1

迷荒 2024-11-26 00:03:26

如果我正确理解您的问题,您可以使用 :has() 选择器:

Cufon.replace("li:not(:has(div))");

If I understand your question correctly, you can use the :has() selector:

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