I'm trying to create a website for learning, and learning web programming meanwhile. Inside of the website, there are some words that are hard to understand, so I wish to put a tooltip/modal to explain the meaning. Here is the prototype of my website: http://findmyself.herokuapp.com/ . Click on chinese word in blue, to see the modal.
While searching on stackoverflow: Tooltips for mobile browsers , I currently have something working.
This is what I'm doing right now.
- a json file as dictionary.
- a json file with the content of the text to display.
- When the front end asks, nodejs send both files. When frontend javascript display on the browser, each word I print on the screen I have to look up into the dictionary and create a html span for the word. So when the user click on the word, its popup the meaning.
The problem is, since i did that, I feel somehow the page is slow to load. I think there is something wrong with my way of doing. And i will have a lot of text later.
I wish to know if there is another way of doing it.
And this is the website that inspire me: https://thuvienhoasen.org/p27a16641/48-dai-nguyen-cua-duc-phat-a-di-da
I hope I'm clear enough. Thanks.