jQuery-rwdImageMaps icon indicating copy to clipboard operation
jQuery-rwdImageMaps copied to clipboard

Works wrong when initial image size is set in percents

Open Stalinko opened this issue 11 years ago • 6 comments

I have image with width=100% and height=100% Script doesn't recognize such values. I've solved that problem by removing these strings and rewriting following condition:

w = $that.attr(attrW), h = $that.attr(attrH);

Stalinko avatar Jan 20 '14 04:01 Stalinko

% values aren't valid values for img attributes. They need to be integer pixels

stowball avatar Jan 20 '14 06:01 stowball

I thought you're crazy, but according to HTML5 spec you have right. But anyway it means your script doesn't support HTML4. I think you should notice that in the docs or just fix it in order to save time for the following generations :)

Stalinko avatar Jan 20 '14 07:01 Stalinko

The problem is that it uses those dimensions to perform the calculations

stowball avatar Jan 20 '14 07:01 stowball

Yes, I read your code. You have a check "if(!w || !h)". You can consider percent values as invalid as well or just all non-numeric values. That will give 100% guarantee that images with wrong width/height attributes will work anyway.

Stalinko avatar Jan 20 '14 07:01 Stalinko

I'll consider it. Thanks

stowball avatar Jan 20 '14 07:01 stowball

Thank you for your work :)

Stalinko avatar Jan 20 '14 08:01 Stalinko