[jQuery] Re: Clickable slideshow not working as expected.

2009-02-01 Thread frederik.r...@gmail.com

When do you call the hover-function? On $(document).ready? To me it
looks like the hover won't work because it is never applied to the
next photo (as it isn't a current-class when loaded). Maybe it should
go like this:

function addMyFunctionality() {
$('.current img.after').hover(
function() {
$(this).animate({opacity: 0});
},
function() {
$(this).animate({opacity: 1});
}

$('.current').click(function() {
$(this).removeClass('current').addClass
('invisible');
$(this).next('div').removeClass
('invisible').addClass('current');
addMyFunctionality();
});


[jQuery] $(this).ready with images

2009-01-31 Thread frederik.r...@gmail.com

Hi!

I have the following task: I have a list of images and some of those
images have a larger version that I want to display in a popup when
clicking on them. As I want to generate those Popup-Links
automatically I need to know the size of the large image. I do this by
loading the large image into the list (without showing), getting it's
height  passing it on to the function generating the popup. Of course
the (hidden) image has to be fully loaded for this. I try to wait for
that by using $('.myimage').ready(function(){actions go here}), but
somehow it won't wait (and returns dimensions of 0x0). As soon as my
browser has cached the images everything works fine. Any idea how to
get the function wait for the image to load?

Code goes like this:
function popup(pfad){

var hoehe = 0;
var breite = 0;

$('.asset:visible').append('img class=sizeCheck src='+pfad+'
style=display:none');


$('.sizeCheck').ready(function(){

$('.sizeCheck').each(function(){
hoehe = this.height;
breite = this.width;
});

$('.sizeCheck').remove();

var Grossansicht = window.open(pfad,'Grossansicht','width='+breite
+',height='+hoehe+',top=20,left=20');
Grossansicht.document.write('htmlheadstyle type=text/cssbody,
html{margin: 0 0 0 0; padding: 0 0 0 0;}/style/headbodyimg
src='+pfad+'/body');
Grossansicht.focus();

});

Thanks alot in advance!


[jQuery] Re: $(this).ready with images

2009-01-31 Thread frederik.r...@gmail.com

Hi  thanks for the answer, it worked fine this way.
Although I understood the documentation in a way that load will only
fire if the image still has to loaded. What happens when the image
already is in the Browser's cache?

Thanks again!



[jQuery] Re: $(this).ready with images

2009-01-31 Thread frederik.r...@gmail.com

Ok! That's great! Thanks for the explanation!