2
내가 이미지에 onLoad 및하여 onResize 크기를 조정하려면이 기능을 사용하는 스크립트가하여 onResize 설정 :는 최대 높이
/**
* Calculates the display width of an image depending on its display height when it is resized.
* @param displayHeight the resized height of the image
* @param originalHeight the original height of the image
* @param originalWidth the original width of the image
* @return the display width
*/
function getDisplayWidth(displayHeight, originalHeight, originalWidth){
var ratio = originalHeight/displayHeight,
res = Math.round(originalWidth/ratio) || 1000;
return res;
}
을 ..하지만 난 800 픽셀을 초과하는 이미지 높이 싶지 않아, 가리키고 심지어 될 수 있습니다 800 × 530px 크기로 고정. res
에 고정 값을 반환하려고했지만 작동하지 않는 것 같습니다.
감사합니다.
효과가 없으므로 스크립트 전체 : http://pastebin.com/GVgzRNrF – 3zzy