Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You need to call the <code>tb_init</code> method manually after setting up the content, for instance, after setting the <code>innerHTML</code> of <code>#videomenue</code> call this:</p> <pre><code>tb_init('#videomenue a.thickbox'); </code></pre> <p>And after the <code>#post</code> call:</p> <pre><code>tb_init('#post a.thickbox'); </code></pre> <p><strong>Also:</strong> You are jumping through a ton of unnecessary hoops since you are already using jQuery. For instance, here was a fast rewrite of all the code you posted, using just jQuery. If you have made the decision to use jQuery, try to use as much of it as possible to clean up your code (as a general practice):</p> <pre><code>function sndReq(req){ var req2 = req, katcheck = req.slice(0, 1); var handleResponse = function(data){ if(data){ if(katcheck == "k"){ $("#videomenue") .html( data ) .animate({"top": "0px", "left": "0px"},{ queue:true, duration:1}).show(500); tb_init('#videomenue a.thickbox'); $('#videoleft').css('float', 'right'); } else { $("#post").html( data ); tb_init('#post a.thickbox'); if(startcheck == true){ startcheck = false; } else { $('#videoleft').show().animate({"top": "0px", "left":"0px"},{ queue:true, duration:800, easing: 'easeOutBack'}); } } } } if( katcheck == "k" ){ var katid = req2.slice(3,4); $.get('getwork.php', { kat: katid }, handleResponse ); } else { var param = req; if( startcheck == true ){ $.get('getwork.php', { id: param }, handleResponse ); } else { $('#videoleft') .animate( {"left": "-800px"}, 600, 'easeInQuad', function(){ $.get('getwork.php', { id: param }, handleResponse ); }) .animate( {"top": "0px", "left": "800px"}, {queue:true, duration:1}, function(){ $(this).hide(); }); } } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload