I'm changing CSS with jQuery and I wish to remove the styling I'm adding based on the input value:
(我正在用jQuery更改CSS,我希望根据输入值删除我添加的样式:)
if(color != '000000') $("body").css("background-color", color); else // remove style ?
How can I do this?
(我怎样才能做到这一点?)
Note that the line above runs whenever a color is selected using a color picker (ie. when mouse moves over a color wheel). (请注意,只要使用颜色选择器选择颜色(即鼠标在色轮上移动时),就会运行上面的一行。)
2nd note: I can't do this with css("background-color", "none")
because it will remove the default styling from the css files.
(第二个注意事项:我无法用css("background-color", "none")
执行此操作,因为它将从css文件中删除默认样式。)
I just want to remove the background-color
inline style added by jQuery. (我只想删除jQuery添加的background-color
内联样式。)
ask by Alex translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…