Image to appear in div when clicked

Permabanned
Joined
22 Apr 2007
Posts
1,805
gents,

I have a thumbnail image that when clicked shows the larger image

The code for which is this

Code:
<a href="images/gallery/bracelet1.jpg"><img src="images/gallery/bracelet1-thumb.jpg" width="140px" height="126px" alt="" 

class="profilephoto" /></a>

Now when clicked, a new blank page loads with the image in

What do I need to do to open the image up so that it sits in the div, or at least adopts some CSS?

EDIT: apart from a hreffing to a html page with the img in the div I mean.
 
Last edited:
really basic way using javascript. :p

Code:
<html>
<head>
<script type="text/javascript">
function show(image) {
	document.getElementById('fullsize').innerHTML = '<img src="' + image + '">';
}
</script>
</head>
<body>
//2 thumbnails
<a href="javascript:show('large/1.jpg');"><img src="small/1.jpg"></a>
<a href="javascript:show('large/2.jpg');"><img src="small/2.jpg"></a>
//place this div where you want the full image to be....
<div id="fullsize"></div>
</body>
</html>
 
Last edited:
Back
Top Bottom