最终,我希望能根据不同的条件动态地改变渐变色,但是如何让jquery应用css3渐变呢?请保留HTML标签。
我错过了什么?我也尝试过。
这些方法不可行吗?
//works
$(element).css("background-image", "url(http://www.google.co.uk/images/logos/ps_logo2.png)");
//doesn't work
$(element).css("background-image","-webkit-gradient(linear,left bottom,right bottom,color-stop(0.50, rgb(194,231,255)),color-stop(0.50, rgb(255,255,255))");
//doesn't work
$(element).css("background-image","-moz-linear-gradient(left center,rgb(194,231,255) 28%,rgb(255,255,255) 28%");
我错过了什么?我也尝试过。
$(element).css({background: "-webkit-gradient(linear,left bottom,right bottom,color-stop(0.50, rgb(194,231,255)),color-stop(0.50, rgb(255,255,255)"});
这些方法不可行吗?