Ok..I've tried to have a go at doing the image preload. Updated script
below.

Even though this "works", I'm sure it could be coded much neater.

For one, I am not sure I am implementing jQuery Timers (http://
jquery.offput.ca/every/) properly.

Thanks
<script type="text/javascript">
var start_image;
var next_image, next_num;

jQuery.preloadImage = function() {
  jQuery("<img>").attr("src", arguments[0]);
}


jQuery.thumb_change = function() {
        start_image = $("img:first",this).attr("src");

        var i=1;
        var preload = true;
        jQuery.timer.add(this, "1s", "thumb_counter", function(){
                next_num = i + 1;
                if (next_num<10) next_num = "0" + next_num;
                next_image = start_image.replace("01.jpg", next_num
+".jpg");
                if (preload) $.preloadImage(next_image);

                $("img:first",this).attr("src", next_image);
                i++;
                if (next_num == 20) {
                  i=0;
                  preload = false;
                }

        });

};

jQuery.thumb_reset = function() {
        jQuery.timer.remove(this, "thumb_counter"");
        $("img:first",this).attr("src", start_image);

};

$(document).ready(function(){
  $('a.thumbnail_link').mouseover(jQuery.thumb_change)
  .mouseout(jQuery.thumb_reset);

});

</script>

THANK YOU!

Reply via email to