My webpage uses JQuery to dynamically hide and show different parts of the content when a button is clicked. However, I am facing an issue where the changes only last for a brief moment before reverting back to the default styling...
Here is a snippet of the code:
$(document).ready(function(){
$("#NavMenu a").on('click', function() {
var chosen = $(this).attr("id");
$(".SubPage").css('display', 'none');
$(".SubPage, #" + chosen).css('display', 'block');
});
});
Where SubPage is the class applied to all sub-articles, NavMenu is the id of the main menu, and each sub-page has its own unique id stored in the "chosen" variable.
* Even when I change the properties being manipulated, such as 'font-size' instead of 'display', the changes still flicker briefly before reverting back.