I'm having some post in php, my table is configuring like this:
while ($row = mysql_fetch_array($res, MYSQL_ASSOC)) {
$id = $row['id'];
$title1 = $row['title1'];
$thumb = $row['thumb'];
$link = $row['link'];
$hex = $row['hex'];
$archiveID= $row['archiveID'];
$recordListingID= $row['recordListingID'];
?>
With that, each item have a specific image, color, etc
Which I display int he front-end like that:
<div id="artist-image">
<img src="<?php echo $thumb ?>"></img>
</div></a></li>
<?php
}
?>
On hover a title, the image of the post display, using jquery:
$('#artistlistdesktop ul li a').hover(function(){
$(this).children('#artist-image').toggleClass('active');|
It's all working fine, but what I'm trying to achieve is on hover a title, to change the color of the title with the hex color assign previously in php via $hex = $row['hex'];
I tried the following css:
#artistlistdesktop li > a:hover{
color:#<?=$hex?>;;
}
but it's changing into the same color to all the list instead of the color assign.
Do you know how can I achieve this?
----EDIT ----
original color is light grey which is this css:
#artistlistdesktop li > a {
display: block;
text-decoration: none;
font-family: Arial Black, Arial, Helvetica, sans-serif;
color: rgba(146,146,146,0.5);
font-weight: bolder;
line-height: 35px;
font-size: 53px;
letter-spacing: -5px;
padding: 0;
margin: 0;
}
--EDIT 2 --
I got it via:
<li><a onMouseOver="this.style.color='#<?php echo $hex ?>'"
onMouseOut="this.style.color='rgba(146,146,146,0.5)'"
id="" target="_blank" href=" ">