Good day,
I am working with CSS3 variables to offset items and many other things in runtime however JQuery's css method ignores any attempt at setting a css var. I try the following
$(document).ready(function() {
$('#testdiv').css('--bgc','rgb(0,0,255)');
});
div
{
--bgc:rgb(255,0,0);
background-color:var(--bgc);
width:50px;
height:50px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<div id="testdiv"></div>
So in theory the div should initially load as a 50px by 50px red box and as soon as page loading is complete change into a blue box however the --bgc variable is never changed on the DIV. Is there any way to set this in JQuery?