Does jQuery .css () method support changing rgba values?

I have <div>

one that has a rgba css value (transparent) that I want to change with one click of a button that is in another <div>

. The problem is I change the color to a hex value and I can't get rgba to work. The code will be posted only if necessary. My question is if .css () supports rgba

+3


source to share


1 answer


try it



var value1=$('#themeBackground1').val();
var opacity=$('#themeOpct1').val();
var rgbData=hexToRgb(value1);
value1='rgba('+rgbData.r+','+rgbData.g+','+rgbData.b+','+opacity+') !important;';
selector.attr('style', 'background-color:'+value1);

      

+1


source







All Articles