Give help. Get help.

  • # June 30, 2009 at 1:07 pm

    How do I get jquery to wait till an image has loaded before it acts. Can I?

    # June 30, 2009 at 10:26 pm

    Wrap your code in this:

    $(window).bind(“load”, function() {


    instead of

    $(function() {


    # July 2, 2009 at 1:06 pm

    @chriscoyier: this makes the code ‘wait’ until the entire page is loaded. I think this is more specific:

    //Do stuff once the image specified above is loaded

    Place that piece of code outside your $(function() { }); or $(document).ready(function(){ });, in this way the function above will be executed when just that specific image was loaded, not the entire page.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.