jQuery的。点击()事件对CSS pseudoelement(:前/:之后)? [英] jQuery .click() event for CSS pseudoelement (:before/:after)?

查看:168
本文介绍了jQuery的。点击()事件对CSS pseudoelement(:前/:之后)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要触发的时候,我通过CSS pseudoelements 插入内容的jQuery的动画:前::在点击。但是,我不知道如何做到这一点;我的第一个猜想, $(#ID:前)。点击()没有工作。是jQuery的功能,这部分?如果是这样,我怎么会选择之前 / 的内容?

I want to trigger a jQuery animation when content that I am inserting through the CSS pseudoelements :before: and :after is clicked. However, I'm not sure how to do this; my first guess, $(#id:before).click() didn't work. Is this part of jQuery's functionality? If so, how would I select the before/after content?

推荐答案

jQuery的不支持CSS :之前:在选择。 <击>选择的兄弟姐妹,使用 .siblings(),然后从那里进行过滤。

jQuery does not support the CSS :before and :after selectors. To select siblings, use .siblings() and then filter from there.

http://api.jquery.com/siblings/

这篇关于jQuery的。点击()事件对CSS pseudoelement(:前/:之后)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆