Real world application with a lot of pages (or "screens") have to deal with problem managing the pages' DOM and memory efficiently and at the same provide a nice smooth transition effect between pages. This is not a real problem when you do it in native apps since Android or iOS already handle the hard work for you, but when come to JavaScript, HTML, and CSS, running on mobile browsers, this is the real challenge.
There are 2 common approaches to solve this problem:
- Approach 1: Keep all the pages in the DOM tree, use CSS (for example
display
) to transit between pages.