简体   繁体   中英

javascript code to populate image links on web page

I'm not sure if javascript is the best solution but here's what i want to achieve. The web page is divided in 3 columns...

The left column should have links in picture format like Arts, History, Science etc Clicking on any of these link should generate a series of links in the rightmost column say clicking on history should generate links for Civilization, World war etc Science should generate links like Physics chemistry represented by pictures etc and so on

Finally Clicking on these links say World war should display the content in the central column giving a brief history on World war.... Also each time a user clicks on an image link say Science it should get highlighted so the user can navigate easily from one topic to another.

I'm a novice to programming, not sure if javascript is the best approach. Also I'm very confused as to how to go about this problem where to begin and how. Any help in terms of code chunks or references or algorithms or advice on how to approach this problem would be most appreciated. If solving this problem means learning a new programming language i'm open to try.....

In case if i'm not clear in explaining the problem let me know

JavaScript would be appropriate for this. The appropriate approach will depend on how much content you have.

If it's reasonably short, you can achieve all of this by simply changing the display property on your elements (use JavaScript to set the CSS of certain page elements to show (display:block) or to hide (display:none).

If you have pages of text, you may want to look into Ajax. It is a bit more advanced that simply showing and hiding elements that are already there.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM