Fancybox: Array-Variable wird nicht übergeben

Ich kann einfach nicht scheinen, dass das passiert!

<code>$(".fancy").click(function(event) {
  event.preventDefault();
  var pic = [];
  $('.room-thumbnail').each(function(index) {
      pic.push('\'' + 'http://localhost' + $(this).attr('href') + '\'' );
  });

  var pics = '['+ pic.join(', ')+']';

  console.log(pics);
  // => ['http://localhost/driver/images/produits/denim/sixthjune-7440/sixthjune-7440.jpg', 'http://localhost/driver/images/produits/denim/sixthjune-7440/sixthjune-7440-back.jpg', 'http://localhost/driver/images/produits/denim/sixthjune-7440/sixthjune-7440-closeup1.jpg', 'http://localhost/driver/images/produits/denim/sixthjune-7440/sixthjune-7440-closeup2.jpg']

  $.fancybox(pics, {
          'transitionIn'      : 'elastic',
          'transitionOut'     : 'elastic',
          'overlayColor'      : '#1D1D1D',
          'type'              : 'image',
          'cyclic': true
      });
});
</code>

Wenn ich die href-URLs (Bilder) manuell eingebe, funktioniert es. Aber wenn ich fancybox die Variable (Bilder) übergebe, erhalte ich den fancybox-Fehler: - Der angeforderte Inhalt kann nicht geladen werden. - Bitte versuchen Sie es später noch einmal. -

Kann mir jemand sagen, was ich falsch mache?

Danke im Voraus.

Antworten auf die Frage(2)

Ihre Antwort auf die Frage