$( document ).ready(function() { if ($('#c{data.uid}-first-tab').hasClass('active')) { $('#c{data.uid}-gridTabContent').css("background-color", $('#c{data.uid}-backgroundColorOne').html()); $('#c{data.uid}-gridTabContent').hover(function () { $('#c{data.uid}-gridTabContent').css("background-color", $('#c{data.uid}-backgroundColorHoverOne').html()); }, function (){ $('#c{data.uid}-gridTabContent').css("background-color", $('#c{data.uid}-backgroundColorOne').html()); }); } if ($('#c{data.uid}-second-tab').hasClass('active')) { $('#c{data.uid}-gridTabContent').css("background-color", $('#c{data.uid}-backgroundColorTwo').html()); $('#c{data.uid}-gridTabContent').hover(function () { $('#c{data.uid}-gridTabContent').css("background-color", $('#c{data.uid}-backgroundColorHoverTwo').html()); }, function (){ $('#c{data.uid}-gridTabContent').css("background-color", $('#c{data.uid}-backgroundColorTwo').html()); }); } if ($('#c{data.uid}-third-tab').hasClass('active')) { $('#c{data.uid}-gridTabContent').css("background-color", $('#c{data.uid}-backgroundColorThree').html()); $('#c{data.uid}-gridTabContent').hover(function () { $('#c{data.uid}-gridTabContent').css("background-color", $('#c{data.uid}-backgroundColorHoverThree').html()); }, function (){ $('#c{data.uid}-gridTabContent').css("background-color", $('#c{data.uid}-backgroundColorThree').html()); }); } if ($('#c{data.uid}-fourth-tab').hasClass('active')) { $('#c{data.uid}-gridTabContent').css("background-color", $('#c{data.uid}-backgroundColorFour').html()); $('#c{data.uid}-gridTabContent').hover(function () { $('#c{data.uid}-gridTabContent').css("background-color", $('#c{data.uid}-backgroundColorHoverFour').html()); }, function (){ $('#c{data.uid}-gridTabContent').css("background-color", $('#c{data.uid}-backgroundColorFour').html()); }); } $('.nav-item-first').click(function () { if ($('#c{data.uid}-first-tab').hasClass('active')) { $('#c{data.uid}-gridTabContent').css("background-color", $('#c{data.uid}-backgroundColorOne').html()); $('#c{data.uid}-gridTabContent').hover(function () { $('#c{data.uid}-gridTabContent').css("background-color", $('#c{data.uid}-backgroundColorHoverOne').html()); }, function (){ $('#c{data.uid}-gridTabContent').css("background-color", $('#c{data.uid}-backgroundColorOne').html()); }); } }); $('.nav-item-second').click(function () { if ($('#c{data.uid}-second-tab').hasClass('active')) { $('#c{data.uid}-gridTabContent').css("background-color", $('#c{data.uid}-backgroundColorTwo').html()); $('#c{data.uid}-gridTabContent').hover(function () { $('#c{data.uid}-gridTabContent').css("background-color", $('#c{data.uid}-backgroundColorHoverTwo').html()); }, function (){ $('#c{data.uid}-gridTabContent').css("background-color", $('#c{data.uid}-backgroundColorTwo').html()); }); } }); $('.nav-item-third').click(function () { if ($('#c{data.uid}-third-tab').hasClass('active')) { $('#c{data.uid}-gridTabContent').css("background-color", $('#c{data.uid}-backgroundColorThree').html()); $('#c{data.uid}-gridTabContent').hover(function () { $('#c{data.uid}-gridTabContent').css("background-color", $('#c{data.uid}-backgroundColorHoverThree').html()); }, function (){ $('#c{data.uid}-gridTabContent').css("background-color", $('#c{data.uid}-backgroundColorThree').html()); }); } }); $('.nav-item-fourth').click(function () { if ($('#c{data.uid}-fourth-tab').hasClass('active')) { $('#c{data.uid}-gridTabContent').css("background-color", $('#c{data.uid}-backgroundColorFour').html()); $('#c{data.uid}-gridTabContent').hover(function () { $('#c{data.uid}-gridTabContent').css("background-color", $('#c{data.uid}-backgroundColorHoverFour').html()); }, function (){ $('#c{data.uid}-gridTabContent').css("background-color", $('#c{data.uid}-backgroundColorFour').html()); }); } }); });