b0bd0gz wrote:

Hi,
I have some thumbnails and when clicked they will load a larger image on the
same page based on the thumbnails "href" value.  Heres the code I'm using to
do this.

        $('a').click(function(){
                var selected = $(this).attr("href");
                $('.full_img').attr("src", selected);
                return false;
        });

What I want to know is, is there a way to display some text saying
"Loading..." until new image is loaded.  Here's the site so far.

Any help would be awesome.
b0bd0gz


b0bd0gz, try this (untested):

$('a').click(function() {
    var a = $(this), text = a.html(), img = $('img.full_img')[0];
    a.html('Loading…');
    img.onload = function() {
        a.html(text);
    };
    img.src = a.attr('href');
    return false;
});


--Klaus

Reply via email to