我正在尝试使用 jquery css 功能将 css 渐变应用到特定的 div,但似乎无法使其正常工作。我无权访问样式表并且遇到了麻烦,因为我试图多次应用它来解决跨浏览器问题。我只是不太确定为什么这不起作用,有什么想法吗?提前致谢
$(document).ready(function() {
//Build your CSS.
var gradient1 = {
"background": "-moz-linear-gradient(top, #fbfbfb 0%, #f4f4f5 100%)"
};
var gradient2 = {
"background": "-webkit-linear-gradient(top, #fbfbfb 0%,#f4f4f5 100%)"
};
var gradient3 = {
"background": "-o-linear-gradient(top, #fbfbfb 0%,#f4f4f5 100%)"
};
var gradient4 = {
"background": "-ms-linear-gradient(top, #fbfbfb 0%,#f4f4f5 100%); /* IE10+ */ background: linear-
gradient(to bottom, #fbfbfb 0%,#f4f4f5 100%)"
};
var gradient5 = {
"filter": " progid:DXImageTransform.Microsoft.gradient(startColorstr=#fbfbfb, endColorstr=# f4f4f5)"
};
//Apply your CSS to the body tag. You can enter any tag here, as
//well as ID's and Classes.
$("#service_DESCRIPTION").css(gradient1);
$("#service_FAQ").css(gradient1);
$("#service_DESCRIPTION").css(gradient2);
$("#service_FAQ").css(gradient2);
$("#service_DESCRIPTION").css(gradient3);
$("#service_FAQ").css(gradient3);
$("#service_DESCRIPTION").css(gradient4);
$("#service_FAQ").css(gradient4);
$("#service_DESCRIPTION").css(gradient5);
$("#service_FAQ").css(gradient5);
});