karacas / imgLiquid

jQuery plugin to resize images to fit in a container.
http://goo.gl/Wk8bU
MIT License
970 stars 207 forks source link

Does not recognise class-based size #36

Closed judgej closed 10 years ago

judgej commented 10 years ago

On FF at least.

I find I MUST use a style attribute to set the width and height of the containing block. A width or height set via a class on that block simply does not work - it leaves the block empty, devoid of any images at all.

This is quite a restriction, especially on systems where the size of the block will vary and is not fixed in the markup. Most responsive sites will be like this. The plugin needs to be able to read the calculated size of the block, and maybe even track changes to that size as the page is resized. Without that, it does not play well with modern web techniques and so should probably be avoided.

karacas commented 10 years ago

Judhej, in this example set size via class works fine:

  http://jsfiddle.net/GvBC3/

Can you make a jsfiddle with a error? Tnx

judgej commented 10 years ago

Yes, you are right. I'll do a bit more digging in the theme we are running to see what it could be interacting with the plugin, then put together the minimum example.