Page 1 of 1

Crop image dynamically

Posted: Thu Nov 15, 2007 12:38 pm
by WaldoMonster

Code: Select all

<span id="progress"></span>

<script type="text/javascript">
document.getElementById('progress').innerHTML = '<img src="progress.gif" alt="" width="' . $width . '" height="5" border="0">';
</script>
I use innerHTML to dynamicaly update a progress bar.
This is working very well when using an image like this:
Image

When I want to use an image like below I can't scale the image like above.
Is there some way to crop the image with Javascript or CSS?
Image