Applying css3 gradients with jQuery

前端 未结 6 1814
-上瘾入骨i
-上瘾入骨i 2020-12-19 01:01

Eventually, I wish to dynamically alter gradients based on different things, but how do I get jquery to apply a css3 gradient?

 //works
 $(element).css(\"bac         


        
6条回答
  •  借酒劲吻你
    2020-12-19 01:28

    I'm using the hyphenated syntax in the JSON format (I always use the JSON format to be consistent). And it's working fine in both Chrome and Firefox.

    For example:

    $("#googleFeed div:even").css({
        'background':'-webkit-linear-gradient(top,white,black)',        
    });
    

提交回复
热议问题