Gradient populated with jQuery?

I have <div>one that needs a gradient background. However, the size of the div is a variable that brings me back to "can't do gradients in CSS."

However, I am sure that this is possible in jQuery, I just can not find a worthy example. Does anyone have something that they can point my way to?

Thanks.

+3
source share
6 answers

if someone needs this and if you think the jQuery plugin is too heavy you can use this

filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00A622', endColorstr='#00B726'); /* for IE */

background: -webkit-gradient(linear, left top, left bottom, from(#00A622), to(#00B726)); /* for webkit browsers */

background: -moz-linear-gradient(top,  #00A622, #00B726); /* for firefox 3.6+ */
+5
source

, , , , , . ; , .

+2
+1

, ? , .

0

, , div, , ?

0

Source: https://habr.com/ru/post/1702272/


All Articles