JQuery element length not working in Chrome #JQuery_tips


Updated July 12, 2013 ● 1,020 views
If you are trying to get the real dimension of an image using jquery, it might be working in Firefox but not in Chrome. The reason is you might be using document.ready function.

When you use document.ready, the image is not loaded yet in Chrome thus the image, length for example, cannot be determine.

You have to use $(window).load() function so the function waits until the image is loaded.

0 Comments


This website uses cookies. By continuing to use this site, you are accepting our Privacy Policy and Terms of Service.