Determinare le dimensioni vere di un immagine con jquery
Un piccolo snippet
findImageSize($("img#myimg"));
function findImageSize(img){
pLog("Finding image size");
var tempWidth = img.width();
var tempHeight = img.height();
img.removeAttr("width").removeAttr("height").css("width","").css("height","");
currentImageHeight = img.height();
currentImageWidth = img.width();
img.width(tempWidth).height(tempHeight);
}
Related posts:
