在google和火狐赌暌姑jquery获取颜色为rgb,怎么转换成为#CCDDFF这种颜色呢
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在google和火狐赌暌姑jquery获取颜色为rgb,怎么转换成为#CCDDFF这种颜色呢相关的知识,希望对你有一定的参考价值。
参考技术A 按理说google和火狐也应该撑持rgb呀,有没可能是其他处所有问题?想rgb转hex颜色的话良多若干好多体例,网上也良多复杂点的:functionrgbToHex(r,
g,
b)
return
"#"
+
((1
<<
24)
+
(r
<<
16)
+
(g
<<
8)
+
b).toString(16).slice(1);
function
componentToHex(c)
var
hex
=
c.toString(16);
return
hex.length
==
1
?
"0"
+
hex
:
hex;function
rgbToHex(r,
g,
b)
return
"#"
+
componentToHex(r)
+
componentToHex(g)
+
componentToHex(b);alert(
rgbToHex(0,
51,
255)
);简单的:
从Google&ŧ039;的CDN获取jQuery库如果失败,则拉取本地版本
Grab jQuery library from Google's CDN this way its faster, burns Google's bandwidth and not yours. Also users will have this cached if other sites are using it as well.Downside of course is Google's servers do go down. This script will check if its available on Google's servers otherwise fall back to your local version.
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> <script>window.jQuery || document.write('<script src="js/libs/jquery-1.6.2.min.js"></script>')</script>
以上是关于在google和火狐赌暌姑jquery获取颜色为rgb,怎么转换成为#CCDDFF这种颜色呢的主要内容,如果未能解决你的问题,请参考以下文章
firefox(火狐)下 js中设置checkbox属性checked="checked"已有,但复选框却不显示勾选的原因