嘿,请检查我的密码
codepen
所以基本上,如果你把两个文本颜色都改成白色,那么它在选定的(绿色图像)中运行良好,但在另一个框中,背景是白色的,因此文本消失。所以我只将p文本更改为白色的选定(绿色图像)框。
$("#franchisehub").click(function() {
if ($('.franchisehubtv').css('display') == "flex") {
$('.franchisehubtv').css('display', 'none');
} else {
$('#franchisehub').css('background-color', 'green');
$('#franchisehub p').css('color', 'blue !important');
$('#franchisehub').find('p').css({color: '#fff'});
$('#cloudbasedmobile').find('p').css({color: '#222'});
$('#cloudbasedmobile').css('background-color', 'white');
$('#businessanalytics').css('background-color', 'white');
$('#techsupport').css('background-color', 'white');
$('#ordermanagement').css('background-color', 'white');
$('#employeemanagement').css('background-color', 'white');
$('#whitelabel').css('background-color', 'white');
$('#emailmarketing').css('background-color', 'white');
$('#royaltycalculator').css('background-color', 'white');
$('#customizationtools').css('background-color', 'white');
$('#goalsetting').css('background-color', 'white');
$('#custominvoicing').css('background-color', 'white');
$('#leadtracking').css('background-color', 'white');
$('#brandcontrol').css('background-color', 'white');
$('.franchisehubtv').css('display', 'flex');
$('.cloudbasedtextipad').css('display', 'none');
$('.business-analytics').css('display', 'none');
$('.tech-support').css('display', 'none');
$('.order-management').css('display', 'none');
$('.employee-management').css('display', 'none');
$('.white-label').css('display', 'none');
$('.brand-control').css('display', 'none');
$('.lead-tracking').css('display', 'none');
$('.custom-invoicing').css('display', 'none');
$('.goal-setting').css('display', 'none');
$('.customization-tools').css('display', 'none');
$('.royalty-calculator').css('display', 'none');
$('.email-marketing').css('display', 'none');
}
});
$("#cloudbasedmobile").click(function() {
if ($('.cloudbasedtextipad').css('display') == "flex") {
$('.cloudbasedtextipad').css('display', 'none');
} else {
$('#franchisehub').css('background-color', 'white');
$('#cloudbasedmobile').css('background-color', 'green');
$('#businessanalytics').css('background-color', 'white');
$('#techsupport').css('background-color', 'white');
$('#ordermanagement').css('background-color', 'white');
$('#employeemanagement').css('background-color', 'white');
$('#whitelabel').css('background-color', 'white');
$('#emailmarketing').css('background-color', 'white');
$('#royaltycalculator').css('background-color', 'white');
$('#customizationtools').css('background-color', 'white');
$('#goalsetting').css('background-color', 'white');
$('#custominvoicing').css('background-color', 'white');
$('#leadtracking').css('background-color', 'white');
$('#brandcontrol').css('background-color', 'white');
$('#franchisehub').find('p').css({color: '#222'});
$('#cloudbasedmobile').find('p').css({color: '#fff'});
$('.cloudbasedtextipad').css('display', 'flex');
$('.franchisehubtv').css('display', 'none');
$('.business-analytics').css('display', 'none');
$('.tech-support').css('display', 'none');
$('.order-management').css('display', 'none');
$('.employee-management').css('display', 'none');
$('.white-label').css('display', 'none');
$('.brand-control').css('display', 'none');
$('.lead-tracking').css('display', 'none');
$('.custom-invoicing').css('display', 'none');
$('.goal-setting').css('display', 'none');
$('.customization-tools').css('display', 'none');
$('.royalty-calculator').css('display', 'none');
$('.email-marketing').css('display', 'none');
}
});