jQuery .click() event for CSS pseudoelement (:before/:after)?

大城市里の小女人 提交于 2019-12-23 06:48:57

问题


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?


回答1:


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/



来源:https://stackoverflow.com/questions/6542392/jquery-click-event-for-css-pseudoelement-before-after

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!