cannot get thickbox to open / tb_show function ignored
        Posted  
        
            by user357034
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by user357034
        
        
        
        Published on 2010-06-18T04:39:40Z
        Indexed on 
            2010/06/18
            4:43 UTC
        
        
        Read the original article
        Hit count: 436
        
I have two links that should open up thickbox's in iframes but only one works (the one with the id of product_photo_zoom_url2). I have the following jquery code that works when this code... All that happens when the first zoom image is clicked is the page goes to the top so it seems that the .click bind is being ignored? How do I get this to work?
onload="vZoom.add(this, '/v/vspfiles/photos/70367301P-2.jpg');" /
is removed from the markup. The above code loads a picture zoom function. See complete markup below.
var titleattr = $("a#product_photo_zoom_url").attr("title"); 
function picurl()
{
tb_show(titleattr, '/PhotoDetails.asp?ShowDESC=N&ProductCode='+ global_URL_Encode_Current_ProductCode + '&TB_iframe=true&height=600&width=520');return false;
} 
$("a#product_photo_zoom_url").click(picurl);
$("a#product_photo_zoom_url2").click(picurl);
$("a#product_photo_zoom_url").attr('href', '#');
$("a#product_photo_zoom_url2").attr('href', '#');
Here is the html code
<a id="product_photo_zoom_url" href="/PhotoGallery.asp?ProductCode=70367301P"
title="70367301P Ignition Box">
<img id="product_photo" src="/v/vspfiles/photos/70367301P-2T.jpg"
border="0" alt="70367301P Ignition Box" onload="vZoom.add(this, '/v/vspfiles/photos/70367301P-2.jpg');" /></a>
    
© Stack Overflow or respective owner