hey everyone, I want to find out if its possible to load an image dynamically on the click of a button, within the same webpage. For example I want to have a thumbnail which has a link to a larger image, which will be loaded without having to open up a pop-up or separate page. I'd have 4 or 5 thumbnails at the top of the page, and then a larger area below that where the larger image is loaded on the click of the thumbnail. Is this possible? How could it be done? I know this is probably a relatively easy question, so sorry for being a newbie LOL ;D regards Jp
Javascript is what you need. You could try a library like JQuery or Prototype but I guess these few lines should do it: <script type="text/javascript"> function changeImg(img, el) { if (el == undefined) el = "fullsize"; i = document.getElementById(el); i.src = img; } </script> <a href="javascript:changeImg('iamge1.png');">image1</a> <img id="fullsize" /> HTML: