2010 05/23 20:19
Category : カレン・システム
imgTrueSize = function(img){
var w = img.width, h = img.height;
if(typeof img.naturalWidth !== "undefined"){
w = img.naturalWidth;
h = img.naturalHeight;
} else if(typeof img.runtimeStyle !== "undefined"){
var run = img.runtimeStyle;
var mem = { w:run.width, h:run.height };
run.width = "auto";
run.height = "auto";
w = img.width;
h = img.height;
run.width = mem.w;
run.height = mem.h;
} else {
var mem = { w:img.width, h:img.height };
img.removeAttribute("width");
img.removeAttribute("height");
w = image.width;
h = image.height;
image.width = mem.w;
image.height = mem.h;
}
return { width:w, height:h };
};
var w = img.width, h = img.height;
if(typeof img.naturalWidth !== "undefined"){
w = img.naturalWidth;
h = img.naturalHeight;
} else if(typeof img.runtimeStyle !== "undefined"){
var run = img.runtimeStyle;
var mem = { w:run.width, h:run.height };
run.width = "auto";
run.height = "auto";
w = img.width;
h = img.height;
run.width = mem.w;
run.height = mem.h;
} else {
var mem = { w:img.width, h:img.height };
img.removeAttribute("width");
img.removeAttribute("height");
w = image.width;
h = image.height;
image.width = mem.w;
image.height = mem.h;
}
return { width:w, height:h };
};