internet explorer 7 - ie7 + jquery. Switching image and detecting size -
Is there a way to detect the actual width of an image in IE 7?
At present, the image that changes (we currently do not know the dimensions) can be zoomed by the user (its # $ ('# img') by changing the height ()). In IE8 and Firefox, we can call the image to be removed at a height to reset it to its natural size and then calculate based on it. The ether does not work in IE 7 removal () and hides the image completely.
Therefore, finding the height works well for the first time, but once zooming comes in play, modify the height and width, so the next image uses these.
I completely want to remove the IMG tag and repeat one without height tags, but is there any other way to get it?
P> Update:
Sorry, it was not very clear. The problem is not with storing weighted height, but when the src tag is updated to change the image, then the height set in HTML / CSS is remembered - it does not use the actual image height There is a need to be able to detect the true image height, that is: how many pixels is it if you open the image. Using the better attit ('height') than IE 7, after loading the image, .height () provides this by reading the property, though removeAttr does not work with IE7, Survivors with the image.
I made examples of Russ C on an example basis:
If you click on 'Image 2' and then click 'Pisces' 'Reset', it loads the image correctly, zooms it, and returns the original size.
However, if you click on 'Click Meat' then 'Image 2' and then 'Reset' it is small (as the coefficient of height is remembered from the shrinking image. Should be able to reach the appropriate image size according to the first example).
I hope this is clear.
Edit: Updated on JSFiddler:
< / Div>
Comments
Post a Comment