1

ここで、イメージ ギャラリーを作成しようとしています: 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];
    })
);

サムネイル画像と大きな画像の両方を表示する必要がありますが、画像が表示されないという問題があります。助けが必要です。

4

1 に答える 1

0

いくつかの問題があります。

  • 1つ目append()は正しく閉じられていません(終了がありません))。
  • 大きな画像のimage代わりに配列を使用しています。limage

これが動作するDEMOです。

于 2012-08-26T12:54:42.053 に答える