mon*_*ers 4 javascript css jquery
我似乎无法让 jQuery.css() 接受 hsla() 值。传递颜色值的格式不是可接受的吗?这是我尝试过的:
// the below variable outputs a variable value with the following format
// hsla(131, 10%, 100%, 1.0)
var finalcolor = "hsla(" +colx +", " +coly +"%, " +"100%, " +"1.0)";
$('#target-div').css('background', finalcolor);
Run Code Online (Sandbox Code Playgroud)
它确实有效,但你的颜色只是白色!
在 firebug / chrome 调试器中检查生成的样式,并检查 HSL 2 RGB 转换器。 http://serennu.com/colour/hsltorgb.php
归档时间: |
|
查看次数: |
2101 次 |
最近记录: |