Setting up a link from var

Setting up a link from var

Hey:

I am creating an image gallery and need some help with how to write this in jquery.

Would like to get the 'src' from a thumbnail and pass it into a var on hover. The reason is that i am loading a tooltip as an overlay ontop of the thumbnail(blocking a direct link), so i have to pass the url(src) to the tooltip and load the image from there.

here is the code:


  1. var url;
  2. $("#dyna img").hover(function(){
            url = $(this).attr("title");
        },function(){
            url = $(this).attr("title");
        });
        
        $('div.dynatip').click(function(){
            alert(url);                        
        });







The page keeps tracing as [object, object]