How do I get images from outside the DOM using jQuery?
<p>I'm using jQuery to control an image gallery that will display any of several different sets of photos.</p>

<p>On an earlier version of the page, a single hidden <code>div</code> held all the images, which would load in the background, and a <code>div</code> called <code>#content</code> into which I would <code>clone()</code> the <code>img:first-child</code>, and then <code>eq(1)</code>, <code>eq(2)</code>, etc. I could also count the <code>img</code> elements in the hidden <code>div</code> to give me a number of images to cycle through. Great.</p>

<p>Now, I'm working with multiple, much larger sets of pictures, and I simply can't have all the images present in the HTML, glomming up the browser in the background. I thought of simply numbering the image files and incrementally changing the <code>src</code> attribute, but I can't count the images if they're not in the DOM.</p>

<p>Ideally, I'd like to grab the contents of a single gallery, like from another html file called <code>gallery_1.html</code> and drop it into that same hidden <code>div</code>, then use the same technique as before.</p>

<p>Is there a way to do this?</p>
