I've developed a single page app where each page is initially set to display:none.
To show pages, I add a class called .current-page:
.current-page{
display:block;
}
So in order to switch between pages, I simply toggleClass('current-page') on the current page and the desired page:
$('.current-page, #'+desiredPage).toggleClass('current-page')
However, there seems to be a slight delay as I see a white flash between page transitions. It appears that one page is hidden before the other is displayed.
Is there a more efficient way to switch between pages without this flashing effect? Any suggestions on how to improve this transition process?