I can't get this script to fire. I did notice it said background is not a defined term? I've used this same script set up for years now, just can't figure out where I went wrong. The action that is supposed to happen will look like this. When any of the 5 Hero sub-sections are click they are supposed to take over the hero and remove it's bg.
function showHidden() {
var alreadyTrue = $(this).find('.hovershow').css('display');
if (alreadyTrue == 'none') {
var swapBg = $(this).css('background');
$('.color-list').css('background', swapBg)
$('.closecolor').css('display', 'block');
$('.color-list .container').css('background', 'transparent');
$(this).css('background', 'rgba(0,0,0,0.5)');
$(this).children('.hoverhide').fadeOut(250).css('display', 'none');
$('.color').not(this).css('display', 'none');
$(this).width('100%');
$(this).find('.hovershow').css({
'display': 'block',
'opacity': '1'
});
} else {
$('.color').width('20%');
$('.hovershow').css({
'display': 'none',
'opacity': '0'
});
$('.hoverhide').css({
'display': 'block',
'opacity': '1'
});
}
};
$('.color').click(function() {
showHidden();
console.log('not working');
});