[jQuery] Re: IE ignores event load()

2008-09-23 Thread Martynas Brijunas

Hi,

 Is your XHTML mark-up valid? (assuming you're writing XHTML) That may
 affect the events behaviour.

I am using XHTML 1.1, the W3 validator gives it all green. Took me a
while to achieve that. I will try the site on IE7 to see if it has the
same problems. Maybe it is the IE6 fault.

Martin


[jQuery] Re: IE ignores event load()

2008-09-23 Thread Martynas Brijunas

RESOLVED:

$(window).load(function() {
$(img.thumb:hidden).addClass(visible); //catch all for all hidden
elements left behind
});

$(document).ready(function() {

$(img.thumb).load(function() {
$(this).addClass(visible); //for the majority of thumbnails, 
this
will happen here
});


[jQuery] Re: IE ignores event load()

2008-09-22 Thread MorningZ

$(window).load(function() {
 $(img.thumb).addClass(visible);
});

will do what you are after



[jQuery] Re: IE ignores event load()

2008-09-22 Thread Martynas Brijunas

Hi MorningZ,

 $(window).load(function() {
      $(img.thumb).addClass(visible);

 });

 will do what you are after

thank you for your response. The problem with this one is that it will
not show a single image until the whole lot has loaded - and that can
be 20 or so seconds if the connection is slow. And then it will show
them all at once.

I am starting to think that I will have to use an array that contains
all image URLs, then artificially create images one by one, and define
the load() event on each. This is something I am not very keen on
doing because I am rendering the HTML by using a django template.

Another potential idea is that I can create a loop once the DOM is
ready and convert invisible objects to visible until none are left.
But at the same time this could lead to CPU spikes and this is
something I am trying to avoid as well.

Best regards,
Martin


[jQuery] Re: IE ignores event load()

2008-09-22 Thread ricardobeat

Is your XHTML mark-up valid? (assuming you're writing XHTML) That may
affect the events behaviour.

On Sep 22, 3:42 pm, Martynas Brijunas [EMAIL PROTECTED] wrote:
 Hi MorningZ,

  $(window).load(function() {
       $(img.thumb).addClass(visible);

  });

  will do what you are after

 thank you for your response. The problem with this one is that it will
 not show a single image until the whole lot has loaded - and that can
 be 20 or so seconds if the connection is slow. And then it will show
 them all at once.

 I am starting to think that I will have to use an array that contains
 all image URLs, then artificially create images one by one, and define
 the load() event on each. This is something I am not very keen on
 doing because I am rendering the HTML by using a django template.

 Another potential idea is that I can create a loop once the DOM is
 ready and convert invisible objects to visible until none are left.
 But at the same time this could lead to CPU spikes and this is
 something I am trying to avoid as well.

 Best regards,
 Martin