Possible Duplicate:
Apply different background color using jquery
I have three divs on a page all with the class .contact-image
I am looking to have these three divs have different background colours (cyan, yellow, magenta)- ideally rgb colors with a transparency of 50%. They don't need to be randomly selected - having as follows is fine. One(Magenta) Two(Cyan) Three(Yellow)
I am a novice to JQuery and so far have got this code from an answer on here to a slightly similar question.
$(function() {
$(".contact-image").each(function() {
var hue = 'rgb(' + (Math.floor((256-199)*Math.random()) + 200) + ',' + (Math.floor((256-199)*Math.random()) + 200) + ',' + (Math.floor((256-199)*Math.random()) + 200) + ')';
$(this).css("background-color", hue);
});
});
This colors all 3 divs a different colour randomly but I don't have the knowledge to adjust this to my needs. Any help will be very much appreciated..