View Full Version : text accordian and load remote images into a div?

138th st
08-22-2008, 06:17 PM

For a project I am working on I am looking to replicate the text acordian / image gallery such as from the drawing and illustration galleries of http://www.misprintedtype.com/v4/

The accordian part is straight forward. I was looking for some ideas for the loading an image into a acordian content div. There are going to be many many images so I don't want to pre-load them.

I had been using a code but found, even outside of the accordian it would load extremely slowly and sometimes not at all:

<script type="text/javascript">
function getImage(pExistingImageID, pImageURL){
var img = document.createElement('img');
img.onload = function (evt) {
img.src = pImageURL;
return false;
<title>Remote Image 5</title>

<p><a href="#" onclick="return getImage('placeHolder','/images/rdivilbiss.jpg');">Get Remote Image</a></p>
<p><img id="placeHolder" border="0" src="/images/placeHolder.jpg"></p>