当我在我的页面上使用它时,背景渐变不会出现(我现在只担心 Safari 和 Firefox):
$("#myElement").css({
backgroundImage: "-webkit-gradient(linear, top, bottom, from(black), to(white)",
backgroundImage: "-moz-linear-gradient(top, black, white)"
});
我尝试在适当的浏览器中只使用一种或另一种,但没有运气。
我可以在我的代码中为元素使用内联样式属性,但如果有办法使用 jQuery 的 API 来做,我宁愿不这样做。