用jQuery设置文本选择颜色。演示不工作
我在css中设置了 :: selection
颜色,因此当您在屏幕上突出显示文本时,文本的颜色为粉色。我正试图在页面加载时通过jQuery覆盖该颜色。似乎应该是超级简单。
I've set the ::selection
color in css, so when you highlight the text on the screen, the color of the text is pink. I'm trying to now override that color through jQuery when the page loads. Seems like it should be super simple. But it's not working for me.
我相信如果你想实现这种效果,你需要应用颜色基于CSS类进行更改。我分了你的jsfiddle,并后面的结果
I believe if you want to achieve this kind of effect, you need to apply the color change based on a CSS class. I forked your jsfiddle, and heres the result
虽然我认为你的问题是有趣的,我有一个困难的时间计算,这可以投入实际使用。您要随时更改主题吗?
Although i think your question is interesting, im having a difficult time figuring where this can be put to practical use. Do you want to change the theme on the fly?