Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7728491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:43:50+00:00 2026-06-01T05:43:50+00:00

I am trying to load multiple images that corresponds to my node when I

  • 0

I am trying to load multiple images that corresponds to my node when I click my thumbnail.

I am able to get it to load 1 image when clicking but I need to load multiple images. I am

loading my thumbnail images with xml.

var $container = $('.window_body');
var images = new Array();
var id = 0;
init();

function init() {
    $('<div class = "thumbnail_layout layout_type"></div>').appendTo('.window_body');
    $.get('sites.xml', function (d) {
        $(d).find('site').each(function (i, l) {
            var imageUrl = $(this).find('imgurl').text();
            var title = $(this).find('title').text();
            var url = $(this).find('url').text();
            var brief = $(this).find('brief').text();
            var long = $(this).find('long').text();
            var classa = $(this).find('_class').text();
            images[i] = $(this).find('img').text();
            $('<div id="' + "p" + i + '" class="' + classa + '"></div>').html('<a> <img src="' + imageUrl + '" class="thumbnail" />' + '<h1>' + title + '</h1> </a>').appendTo('.thumbnail_layout');
        });
        $(".item").click(function () {
            var index = $(this).prevAll().length;
            var datelength = $(".item").length
            for(var i = 0; i <= datelength; i++) {
                if(i == index) {
                    $("#holder").empty();
                    $("#holder").prepend('<img id="my_img" src="' + images[i] + '" />');
                } else {}
            }
        });
    })
}

XML:

<?xml version="1.0" encoding="iso-8859-1"?>
<sites>
    <site>
        <imgurl>images/thumbnail_big_a.jpg</imgurl>
        <title>test</title>
        <url>http://www.1.com</url>
        <desc>
            <brief>brief description.</brief>
            <long>long description</long>
        </desc>
        <bimgurl>
            <img>images/thumbnail_big_a.jpg</img>
            <img>images/thumbnail_big_b.jpg</img>
            <img>images/thumbnail_big_a.jpg</img>
        </bimgurl>
        <_class>item red</_class>
    </site>
</sites>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T05:43:51+00:00Added an answer on June 1, 2026 at 5:43 am

    You could store the node set you get from $(this).find(‘img’) instead of just the text:

            images[i] = $(this).find('img').text(); 
    

    Then in the click handler do something like:

    images[i].each(function() {
        $("#holder").prepend('<img id="my_img" src="' + $(this).text + '" />');  
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to load a very basic XML document but everytime I get
I am trying to load multiple images onto a canvas using html5 img tag.
I've been trying to load multiple files into a table, so that they would
I'm trying to test a SOCKS proxy that's under load from multiple machines. The
I have a 200 x 30 png-24 image that I am trying to load
I am trying to use local storage to be able to save/load multiple sets
I am trying to load multiple elements with the same name from XML into
trying to load in a bunch of images into a list from a directory...my
Im trying to load a image at runtime in WPF using the following code
I am using AS3 to create a tween affect between multiple images that have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.