Here I am trying to create an Image Gallery: http://jsfiddle.net/5wETg/62/.
var xml = "<rss version='2.0'><channel> <image>http://www.nikon.com/swf/img/thumbnail_ophthalmic_lenses.png</image> <image>http://www.nikon.com/swf/img/thumbnail_ophthalmic_lenses.png</image> <image>http://www.nikon.com/swf/img/thumbnail_ophthalmic_lenses.png</image> <limage>http://images1.videolan.org/images/largeVLC.png</limage> <limage>http://images1.videolan.org/images/largeVLC.png</limage> <limage>http://images1.videolan.org/images/largeVLC.png</limage> </channel></rss>",
xmlDoc = $.parseXML( xml ),
$xml = $( xmlDoc ),
$image= $xml.find( "image" );
$limage = $xml.find("limage");
$( "#thumbs" ).append( $image.map(function(){
return $('<img>', {className: 'thumbnails', src:$(this).text()})[0];
})
$( "#panel" ).append( $image.map(function(){
return $('<img>', {className: 'largeimages', src:$(this).text()})[0];
})
);
I have to show both the thumbnail images and larger images, but there is problem images are not getting displayed. I need some help.
There are a couple of problems:
append()is not being closed correctly (you’re missing the closing));imagearray instead oflimagefor the larger images.Here’s a working DEMO.