【发布时间】:2011-09-08 21:34:35
【问题描述】:
当我在我的页面上使用它时,背景渐变不会出现(我现在只担心 Safari 和 Firefox):
$("#myElement").css({
backgroundImage: "-webkit-gradient(linear, top, bottom, from(black), to(white)",
backgroundImage: "-moz-linear-gradient(top, black, white)"
});
我尝试在适当的浏览器中只使用其中一种,但没有运气。
我可以在我的代码中为元素使用内联样式属性,但如果有使用 jQuery 的 API 的方法,我宁愿不这样做。
【问题讨论】:
-
我在 Firefox 6.0.1 版本中测试过,它对我有用
标签: jquery css linear-gradients