Interactive Image re-sizer
Here's the code you need - follow each step carefully, mind!
Step One:
Place this script in the head of the page. Set the six dimensioning variables where shown in the script (below).
Step Two:
In the body, give each image a unique name and attach the functions as shown:
<img src="someimage.jpg"
name="imageOne"
width="100" height="100"
onDrag="dragResizeImage(event,this.name)"
onClick="clickResetImageSize(this.name)">
<img src="anotherimage.jpg"
name="imageTwo"
width="100" height="100"
onDrag="dragResizeImage(event,this.name)"
onClick="clickResetImageSize(this.name)">
Any number of images may be used; however, all should usually be the same
default size. I'll give you a tip, here - save the image you're going to use at
its maximum resolution you're likely to get used on your page, but initially
sized smaller - it's great for screen dumps and so on!
Step Three
Add the following to your <body> statement:
onload="iBeReady=true;"
so it looks like:
<body onload="iBeReady=true;">
And that's pretty much all there is to it! Click here to get back to the demo!