如何爲jQuery中的css屬性指定特定於瀏覽器的回退?如何爲瀏覽器特定的css表達式回退
E.g.我想要做的
h1 {
background-image: -webkit-linear-gradient(left, white, black);
background-image: -moz-linear-gradient(left, white, black);
background-image: -o-linear-gradient(left, white, black);
background-image: -ms-linear-gradient(left, white, black);
}
$('h1').css({'background-image': x, 'background-image': y})
等效 - 當然JS語法將只允許一個「背景圖片」鍵。$('h1').css('background-image', x).css('background-image', y)
- jquery將覆蓋第一個值。$('h1').css('background-image', x + ',' + y)
- 瀏覽器不喜歡它。
在這種情況下,坡度值的實際顏色編程確定,並且不限制爲一組有限的可能值,這樣就不會針對此問題的工作。 –
然後即時編寫樣式。 – graphicdivine
不完全確定我明白你的意思。 –