I have a li
, which is a square, so CSS is
.produtos{
width: 294px;
height: 349px;
/*background-color: #f1f2f2;*/
border: 3px solid transparent;
position: relative;
cursor: pointer;
transition: all .4s ease-out;
background-repeat: no-repeat;
}
What happens is that I want to change the color of border
when the user hover over it.
I can not do this with the% css% simple of CSS, because this color will be manageable. I already have a reserved word that will apply this color, I just think it would be ideal to use an attr in Jquery, am I right?
My HTML looks like this:
<li data-cor="codigoSYS" style="background-image: url(fotoSYS&w=294)" class="produtosBorda produtos f-left margin-right-30 margin-top-30"></li>
CodeSYS is the hexadecimal value of the color that is received by the manager.
Jquery:
var cor = $('.produtosBorda').attr('data-cor');
$('.produtosBorda').css('border-color', cor);