$(document).ready(function() {
$('.red').hover(function() {
$('.yellow, .green').fadeToggle('slow');
});
var bg_colour = $('.yellow').css('background-color')
$('.blue').click(function(){
alert($('.yellow').css('background-color'))
if(bg_colour=='rgb(255, 255, 0)') {
$('.yellow').css('background-color', '#0F0');
$('.green').css('background-color', '#FF0');
} else {
$('.yellow').css('background-color', '#FF0');
$('.green').css('background-color', '#0F0');
}
});
});
It functions up to a point but I can't seem to get the else part to do anything. It is meant to change the colors of the two div's back to their original back-ground colors. Any ideas?