Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Facebox & Uploadify
  • Hi all,

    First of all thanks to the creator(s) of uploadify. It really made our life easy.

    I get it all working and setup, but I'm only having one problem. I use the following code to show thumbnails when the images are uploaded:


    $('#thumbnails').append('<div id="thumbs"><img src="../small/' + response + '" /><span class="close"><img src="resources/images/close.png"></span></div>');


    Now I would like to show the large image when the user clicks on the thumbnails with FaceBox. I tried applying a "rel" on the link, but it just doesn't work.


    $('#thumbnails').append('<div id="thumbs"<a href="../gallery/'+response+'" rel="facebox"> <img src="../small/' + response + '" /></a><span class="close"><img src="close.png"></span></div>');


    It keeps opening the image in a new page. Has anyone tried this before? Is there a workaround for this?


    Thanks in advance. :)
  • You might need to re-initialize the facebox plug-in after you append the thumbnail. When facebox is initialized on page load, the thumbnail doesn't exist so it isn't applying itself to the link. Maybe nest another instance of facebox in the onComplete function.
  • Great. Thank you very much.

    Edit:
    Just tried it out, but no matter what I do I can't get it to work. Thanks anyway for the help. :)
  • moonwalker said:
    $('#thumbnails').append('<div id="thumbs"<a href="../gallery/'+response+'" rel="facebox"> <img src="../small/' + response + '" /></a><span class="close"><img src="close.png"></span></div>');

    Unless I'm missing something obvious, it doesn't look like your html is well formed (missing > on the div)
    $('#thumbnails').append('<div id="thumbs"><a href="../gallery/'+response+'" rel="facebox"> <img src="../small/' + response + '" /></a><span class="close"><img src="close.png"></span></div>');