Diogo - Thank you very much for the response.  I am having a bit of trouble
figuring out where to fit this additional code.   I tried a few locations
within my existing code and I am not having much luck.  'image.slide'  What
is that?  I am not sure how that is used.  Any additional help you or anyone
could provide would be much appreciated.  Thank you, Tobias

Diogo Shaw wrote:
> 
> 
> $.fn.image = function(fn) {
>       var total = this.length, loaded = 0;
>       this.each(function() {
>               var i = new Image();
>               i.src = this.src;
>               $(i).load(function(){
>                       loaded++;
>                       if(loaded==total) fn();
>               });
>       });
> }
> 
> // eg
> $('img.slide').image(function() {
>       // success;
> });
> 
> 
> Diogo Shaw
> 
> 

<code>

$().ready(function()
{

///Additional CODE
$.fn.image = function(fn) {
        var total = this.length, loaded = 0;
        this.each(function() {
                var i = new Image();
                i.src = this.src;
                $(i).load(function(){
                        loaded++;
                        if(loaded==total) fn();
                });
        });
} 
//End Additional CODE

//hides the div holding the loading graphic
$("#loaderdiv").hide(); 


 $("#imageOptions a").bind("click", function()
{


//here is where I figured a slight mod to add the /large folder
var imageSource = $(this).children("img").attr("src");

$("#loaderdiv").show();

var newimageSource = imageSource.replace("/small/", "/large/");

$("h4").remove();

//for testing purposes
var checkimage = newimageSource;
//console.debug(checkimage);
//Checking done
showImage(newimageSource);
//was
return false;
//return checkimage;
});

});






function showImage(src) {

//Additional Code
$('img.slide').image(function() { 
//Above

$("#loader img").fadeOut("normal").remove();
var largeImage = new Image();

$(largeImage).load(function() {

$(this).hide();
$("#loader").append(this);
$("#loaderdiv").fadeOut("fast").hide();
$(this).fadeIn("slow");




});


$(largeImage).attr("src", src);

//Additional Code Close
});
//Above

} 


</code>

-- 
View this message in context: 
http://www.nabble.com/Help--jquery-Dynamic-Image-load---dbl-click-%3D-loads-twice-tp22607358s27240p23136578.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.

Reply via email to