Thanks Lukas. However, this doesn't solve my problem.
The fade-out of the old image works. Also the fade-in of the new image
works. But after the fade-in, the image disappears again.

On 5 okt, 08:38, lukas | dressy vagabonds <[EMAIL PROTECTED]>
wrote:
> some time ago i started a rewrite of the lightbox plugin for jquery
> and i encountered the same problem.
>
> strangely, safari doesn't support the Image() function in a way, that
> it creates a new DOM-Element for you.
> the solution was not to use the javascript Image() function but use
> img = document.createElement('img') and work with that.
>
> cheers
>
> lukas
>
> Am 04.10.2007 um 10:34 schrieb bytte:
>
>
>
> > I have made a very basic slideshow, with help from this list, that
> > looks for images in a database, then displays them. Here's the link:
> >http://www.sum.be/project/item.php?item=14&ID=39〈=1 (navigate
> > through the pics by using the small arrows to the right of the
> > picture)
>
> > It works ok in all tested browsers (ff mac/win, ie, opera mac/win),
> > yet not on safari (mac+win).
>
> > As you'll see there's a problem with the fadeIn/fadeOut resulting in a
> > blank space where the picture should reside.
>
> > Here's the code I use to make the old picture fadeOut and the new one
> > fadeIn:
>
> > function showNewPic(json,lang) {
> >      var img = new Image();
> >      img.onload = function(){
> >           $('.jq_loading').hide();
> >           $('.projectpic').fadeOut("fast",function() {
> >                $('.projectpic').attr({ src: "../layout/images/
> > uploads/"+json.picture, id: "jq_" +json.item_ID+ "_" +json.menu_een_ID
> > + "_" +json.menu_twee_ID+ "_" +lang+ "_" +json.ID, alt:
> > json.alt }).fadeIn("fast");
> >           });
> >      }
> >      img.src = "../layout/images/uploads/"+json.picture;
>
> > }
>
> > Any idea why it fails in Safari? The Safari Javascript console gives
> > me no errors whatsoever.
> > (sorry for the double post - topic was here already a week ago, but
> > i'm desperate)

Reply via email to