If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

In FireFox, this is adjusting every image that is wider than 300 pixels to be 300 pixels and it's keeping the ratio for the height. Works great.

IE and Chrome, however, are a different story. Random images greater than 300 pixels are resizing correctly - and the ones that do resize are different with every page reload or refresh.. it's not always the same ones.

I appreciate anyone's thoughts/suggestions on this.

Thank you,

^_^

If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.* The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

You are testing the widths of images that haven't finished loading yet because your code is running as soon as the HTML finishes loading without testing if all the images are loaded yet.

I assumed that since the code was placed in $(document).ready() that it would work after the images were fully loaded. So jQuery ready() will spring into action before images are fully loaded?

^_^

If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.* The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

Thanks, rnd me and VIPStephan. I'll use the CSS.. was just hoping to get it to work in JS, just for poops and smiles.

^_^

If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.* The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

! So much that I don't know about jQuery.. didn't realize that there was a $(window).load(). I'll give that a shot. Thanks, xelawho!

^_^

If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.* The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

Just like other common events (click, mouseenter, etc.) both can be used, the .on() function as well as the shortcut.

And by the way, the above mentioned source also says:

Caveats of the load event when used with images
A common challenge developers attempt to solve using the .load() shortcut is to execute a function when an image (or collection of images) have completely loaded. There are several known caveats with this that should be noted. These are:

It doesn't work consistently nor reliably cross-browser

It doesn't fire correctly in WebKit if the image src is set to the same src as before

It doesn't correctly bubble up the DOM tree

Can cease to fire for images that already live in the browser's cache

And WolfShade, $(document).ready() actually fires when the DOM tree (i. e. the plain HTML) has been built/parsed completely. This is different from when all the contents have loaded. A document can be ready for manipulation while images are still loading; and it is ready when the HTML has been read from top to bottom, regardless of what else happens on the page.

Thanks for the additional, VIPStephan. I just took xelawho's suggestion and tested it in FireFox - it worked. Haven't tested it in IE or Chrome, yet. I'll do that, now.

BTW.. this all started as an experiment; learning to use ColdFusions Virtual File System.. the images are in the server memory.

^_^

If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.* The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

Tested several times in FF12, IE8, and Chrome(no idea of version number).

In IE8 and Chrome, every image that is wider than 300 pixels initially loads in its original size, and then is quickly resized to 300 pixels wide, keeping the ratio for height.

In FF, it happens so fast that it appears as if images larger than 300 pixels wide load at 300 pixels wide.

So far, $(window).load() is working as expected.

Thanks, everyone.

^_^

If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.* The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

I would think that getting filed in the "deprecated" category (breadcrumb, top right) and getting labelled as "version deprecated: 1.8" would qualify it as being deprecated, but maybe I am reading the docs wrong.

My interpretation of the caveats is that they apply to a situation where you are using the "load" listener directly on an image, such as

I would think that getting filed in the "deprecated" category (breadcrumb, top right) and getting labelled as "version deprecated: 1.8" would qualify it as being deprecated, but maybe I am reading the docs wrong.

Ah right, didn’t read the breadcrumb, sorry. I think they should make it a little more obvious, like in a notice (e. g. in a gray box, as they already have others).