Currently, I am faced with a challenge on my website where I have multiple pages that utilize PHP to include content and jQuery to toggle the display of said content by adjusting CSS properties. However, I am encountering difficulty in implementing this functionality on the main page which features a menu system. I am seeking a solution where clicking a menu link will not only navigate to the corresponding page but also apply the appropriate CSS rules to show the relevant content. Here is what I have attempted so far (URL redacted):
<script type="text/javascript">
$(document).ready(function(){
$('#ourMissionMenu').click(function() {
window.location = 'http://beta.***.com/aboutUs.php';
$('#rightReplace').css({
"display":"none"
});
$('#ourHistory').css({
"display":"none"
});
$('#meetTeam').css({
"display":"none"
});
$('#communityOutreach').css({
"display":"none"
});
$('#connectUs').css({
"display":"none"
});
$('#blog').css({
"display":"none"
});
$('#ourMission').css({
"display":"block"
});
});
});
</script>