How do you avoid this from happening? I saw that there were some files for this... but how do you add them to your html document? Is there any place to learn about this?
Use the HTML Gesture APIs. There is a sample file at the end of this article: Create HTML articles for AEM Mobile