Brug af Resize script...
Hej..Er rimelig ny til javascript.
Fandt dette script på nettet til at resize billeder med.
<script type="text/javascript">
var resize = function(img, maxh, maxw) {
var ratio = maxh/maxw;
if (img.height/img.width > ratio){
// height is the problem
if (img.height > maxh){
img.width = Math.round(img.width*(maxh/img.height));
img.height = maxh;
}
} else {
// width is the problem
if (img.width > maxh){
img.height = Math.round(img.height*(maxw/img.width));
img.width = maxw;
}
}
};
</script>
Har så en div med et img tag, hvor jeg skal have resized billedet ind i..
Men.. men.. da jeg er ny, vides der ikke lige hvordan dette script bruges/kaldes.
Håber i kan hjælpe her.
