I'm with rolf on this - this is almost certenly a page cache issue. add a
timestamp param to the img url and see if it fixes the issue

On Sun, Feb 6, 2011 at 9:33 AM, stratboy <[email protected]> wrote:

> I think jsfiddle is not necessary here, and I don't have much time to
> setup a jsfiddle entry.
> I think I'm just doing something wrong in the code and I can't find
> the error.
> Once upon a time a programmed page link was enough.. :P
> I'll go for another way maybe.
>
> Thank you anyway
>
>
>
> On 5 Feb, 14:00, Rolf -nl <[email protected]> wrote:
> > can you put up the example code at jsfiddle?
> > can you add a random id or a timestamp to the images so that the
> > images aren't cached, its easier testing that way else images are 304
> > not modified after 1 test etc.
> >
> > On Feb 4, 10:29 pm, stratboy <[email protected]> wrote:
> >
> > > Not strange enough? :)))
> >
> > > On 4 Feb, 11:26, stratboy <[email protected]> wrote:
> >
> > > > This is even more strange:
> >
> > > >http://reghellin.com/debug/image-preloader/
> >
> > > > here the relevant code:
> >
> > > >         prepare:function(){
> > > >                 this.images = this.image_box.getElements('img');
> > > >                 this.images.each(function(image,index){
> >
> > > >                         this.data.push({image:image,
> src:image.get('src')});
> > > >                         image.set({
> > > >                                 'src':'',
> > > >                                 'styles':{
> > > >                                         //'opacity':0,
> > > >                                         //'visibility':'hidden'
> > > >                                 }
> > > >                         });
> > > >                 },this);
> > > >         },
> >
> > > >         load_image:function(){
> > > >                 var img = new
> Asset.image(this.data[this.image_index].src, {
> > > >                         onLoad:function(img_tag){
> > > >                                 $(document.body).innerHTML +=
> img_tag.get('src')+'<br>'
> > > >                                 var data =
> this.data[this.image_index];
> > > >                                 data.image.set('src',data.src);
> > > >                                 console.log(data.image);
> >
> > > >                                 this.image_index += 1;
> >
> > > >                                 if(this.image_index <
> this.data.length){
> > > >                                         this.load_image();
> > > >                                 }
> > > >                         }.bind(this)//fine onLoad
> > > >                 });//fine asset
> > > >         },
> >
> > > > in prepare() I fill the data array with the images and strip out the
> > > > src prop to stop the browser natural loading process. ok.
> >
> > > > in load_image, onLoad, I set the src prop again. It does, but.. Not
> in
> > > > on the window.images.. It seems as I filled the array with a copy of
> > > > the images instead of the images themselves. More, If i, from onLoad,
> > > > try to reference the images direcly, like:
> >
> > > > $('image-box').getElements('img')[0].setStyle('border','1px solid
> > > > #ff0000')
> >
> > > > it won't work!!! Uh???
> >
> > > > Any idea? :(
>



-- 
Arieh Glazer
אריה גלזר
052-5348-561
http://www.arieh.co.il
http://www.link-wd.co.il

Reply via email to