Crop image dynamically

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
WaldoMonster
Forum Contributor
Posts: 225
Joined: Mon Apr 19, 2004 6:19 pm
Contact:

Crop image dynamically

Post 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
Post Reply