Here is the new version $('a', '.img').click(function(){ $(this).blur(); var href = $(this).attr("href"); var imgl = new Image(); if ($('img', '#preview')){ $('img', '#preview').fadeTo("fast",0.0).remove(); } $('.dummy5').css( { height: 12 + 'px' } ); imgl.src = href; imgl.onload = function() { $('#preview').parent().css( { width: this.width + 24 + 'px', height: this.height + 32 + 'px' } ); imgl_width = this.width; imgl_height = this.height; $('#preview').html(imgl); $('img', '#preview').fadeTo(0,0.0).fadeTo("fast", 1.0); }; return false; });
and it bugs a little as you can see on my gallery site (... i didn't come up with a fix yet so anyone please help! On May 7, 4:26 pm, joomlafreak <[EMAIL PROTECTED]> wrote: > Sorry I think this line > isImage = $(".preview").size(); > > should be like this > isImage = $(".preview/img").size(); > > joomlafreak wrote: > > I am sorry but I found your code little complicated. Anyways I can > > suggest something like this > > > $('a').each( > > function() > > { > > ok = $(this); > > href = ok.attr('rel')||''; > > ok.bind('click', function(){ > > isImage = $(".preview").size(); > > if (isImage ==1){ > > $(".preview").fadeOut("slow",function(){ > > $(".preview").html('<img width="600" height="400" > > src="'+href+'">').fadeIn("slow"); > > }); > > }); > > } > > ); > > > Hope this helps. BTW nice though of creating such a gallery. good > > luck. > > > On May 6, 10:34 pm, Equand <[EMAIL PROTECTED]> wrote: > > >http://nosite.ru/HU/ > > > so as you see i figured most of it... except the transition... > > > it bugs by displacing... and doesn't seem to work correctly, i wanted > > > to on load of new to fade out the old and fade in the new... if you > > > look in the code u can see this, thanx in advance