# Image buttons that load another image?

**URL:** <https://forum.kirupa.com/t/image-buttons-that-load-another-image/265790>\
**Category:** Uncategorized\
**Created:** [July 12, 2008, 2:46pm UTC](https://forum.kirupa.com/t/image-buttons-that-load-another-image/265790 "2008-07-12T14:46:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sebus](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@sebus](https://forum.kirupa.com/u/sebus)\
**Post date:** [July 12, 2008, 2:46pm UTC](https://forum.kirupa.com/t/image-buttons-that-load-another-image/265790/1 "2008-07-12T14:46:27Z")

</div>

I want to create a site where there will be 5 buttons on the left that are images. When you click each, a larger image loads on the right side, you click next button the image corresponding to that button loads. How is this done? HTML CSS?

---

<div class="post-metadata">

**Author:** ![jwilliam](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@jwilliam](https://forum.kirupa.com/u/jwilliam)\
**Post date:** [July 12, 2008, 7:20pm UTC](https://forum.kirupa.com/t/image-buttons-that-load-another-image/265790/2 "2008-07-12T19:20:58Z")

</div>

You could use javascript to cache the images when the page loads and then display them when the user clicks a link. You’ll need to use the Image Object and the onclick event handler. Google those and you’ll find some tutorials, I’m sure…

Another route would be to use a scripting language like PHP to output the right image depending on which link they clicked.
