- \r
- memW = img.width;\r
- memH = img.height;\r
- // keep current style\r
- img.removeAttribute( 'width' );\r
- img.removeAttribute( 'height' );\r
- w = img.width;\r
- h = img.height;\r
- img.width = memW;\r
- // restore\r
- img.height = memH;\r
+ \r
+ memW = w = img.width;\r
+ memH = h = img.height;\r
+ \r
+ if( img.removeAttribute ){ // Safari1.3 の Image は removeAttribute がない\r
+ // keep current style\r
+ img.removeAttribute( 'width' );\r
+ img.removeAttribute( 'height' );\r
+ \r
+ w = img.width;\r
+ h = img.height;\r
+ \r
+ // restore\r
+ img.width = memW;\r
+ img.height = memH;\r
+ };\r