Not signed in (Sign In)

Categories

Welcome, Guest

Want to take part in these discussions? If you have an account, sign in now.

If you don't have an account, apply for one now.

Links

Vanilla 1.0.1 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorSylvain
    • CommentTimeMay 21st 2007
     
    Hi,

    I don't know if it is an issue or an implementation problem but the content of some of tb's was loading twice under various circumstances. What I did was change this line
    $("#TB_window").append("<a href='' id='TB_ImageOff' title='Close'><img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/></a>" + "<div id='TB_caption'>"+caption+"<div id='TB_secondLine'>" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='Close'>close</a> or Esc Key</div>");

    to something like this:
    $("#TB_window").empty().append("<a href='' id='TB_ImageOff' title='Close'><img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/></a>" + "<div id='TB_caption'>"+caption+"<div id='TB_secondLine'>" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='Close'>close</a> or Esc Key</div>");

    I don't see any problem with it yet and can't seem to figure out a reason why the original code doesn't clear the thickbox before appending... Do any of you know why?
  1.  
    I have a simlar thing happeneing (TB 3.1), where content seems to be showing twice. i.e., it will show the image, caption, gallery pagination and close link all twice (looks like a carbon copy straight after it). I have tried a simlar thing (using empty() before append) but this doesn't seem to fix the problem.

    Has anyone had a similar problem or is there a known issue? One thing I will say is that it doesn't seem easy to reproduce the error consistently - it almost appears to be happening randomly, where it will pop up fine most time, but once in a while will repeat the append code, so that as far as the visitor is concerned, it shows a poorly styled thickbox with a second image below the first, shifted to the right.
    • CommentAuthorwebvillage
    • CommentTimeJun 4th 2010 edited
     
    I had something similar, but it was only the title bar that was being duplicated. I found some documentation that said this happens when Thickbox is being called twice. However, I wanted it to be called twice because I added the dataTables script (Which is fantastic, by the way. See http://www.datatables.net/ for details.) and dataTables was removing Thickbox from its memory so the pop-ups weren't popping up from inside the dataTable table, but they would still work outside of the table.

    In order to get the pop-ups to work in dataTables, I had to use the dataTables fnDrawCallback command to reinitialize Thickbox after drawing the table. Like so:

    "fnDrawCallback": function() {
    tb_init('a.thickbox, area.thickbox, input.thickbox');
    }

    That worked great, except the pop-ups outside of the dataTable would now have two title lines because they saw Thickbox as being called twice. The pop-ups called from inside the dataTable had only one title.

    So my solution was to add this in thickbox.js just before appending the title:

    $("#TB_title").remove(); // I added this line
    $("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='Close'><img border='0' src='/img/icons/close.png' alt='X' /></a></div></div><iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;' > </iframe>");

    Now the pop-ups have only one title line whether they're called from inside or outside the datatable.
  2.  
    I'm having a similar problem, but mine's a little different. For mine, the AMOUNT of the thickboxes are being duplicated, but the CONTENT is not...

    ...So if the thickbox W x H is 100 x 50, then some links will click and open up a 100 x 100 but only the top 100 x 50 will be the content. The bottom half is blank. Other times the thickbox will open up to 100 x 150 (three times as tall), but only the top 100 x 50 will be the content again (and in this case the bottom 2/3 will be blank).

    It's very strange. It's like each time a thickbox is created it adds it below the last thickbox (but doesn't add the content - only its "shell").