1
I own a li
, which is a square, the CSS is like this
.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 I want to change the color of border
when the user hovers over.
I can’t do that with the hover
simple CSS, because this color will be manageable. I already have a reserved word that will apply this color, I just think the ideal would be to use an attr in Jquery, I’m sure?
My HTML is 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>
code 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);
Do you have an excerpt of html code, css and an example of what the final result would look like? because there may be several solutions there if you can choose the best to your code!
– Maria