Purchase Advertising On AWT
 Upload & Sell Your Software
 Upload & Sell Your eBook
 Enter The AWT Control Panel  Contact Applied Web Tools
 Sell Your eBook @ The Book Store  Password Troubles? Click Here!
Knowledge Center
Want to write for Applied Web Tools? Send your Writer's Query to
Editor@AppliedWebTools.net for details.
HTML
Reference
&
Tutorial
CSS
Reference
&
Tutorial
DOM
Reference
&
Tutorial
JavaScript
Reference
&
Tutorial
50+ Programming Examples
Use HTML, CSS, DOM & JavaScript Together
Misc. Essays & Documents
You'll Find Just About Anything In Here
50+ Web Page Constructions
Learn the Art of Using HTML, CSS, DOM & JavaScript Together
 Changing Background Colors
 Event Triggering With onLoad
 Disabling The Right Click
 DOM Driven Color Changing
 Switching Images
 innerHTML Attribute Access
 Change With innerHTML
 Changing Positions
 Change Position With onMouseMove
 Change Text Position
 Interactivity Skills
 Type-writing A Message
 Auto-changing Text Size
 Making Text Scroll
 Blinking Text
 Simple Form Authentication
 Change Background Color Of An INPUT
 Change Text Color Of An INPUT
 Change Background Image Of An INPUT
 Select All Checkboxes
 Select Color Of The Submit Button
 Change Text Color Of A Submit Button
 Insert Background Image To A Button
 Change Color Of Drop Down List
 Change Text Color Of A Drop Down List
 Change Color Of A TEXTAREA
 Change The Text Color Of A TEXTAREA
 Insert An Image Into A TEXTAREA
 Change The Size Of An Image
 Change The Source Of An Image
 Change The Position Of An Image
 Change The Background Image
 Moving Images Around The Page
 Drag & Drop An Image
 A Simple Image Viewer
 A Shaking Image
 A Digital Clock
 Drop Down List Link
 Top Drop Down Menu
 Always On Top Menu
 Inset Border Buttons
 A Description Generating Menu
 An Image Generating Menu
 A Horizontal Sliding Menu
 A Click Horizontal Sliding Menu
 Returning Cursor Co-ordinates
 Making Text Follow The Cursor
 Attaching An Image To The Cursor
change the size of an image

It is entirely possible to change the size of an image. You may apply the changes to the same image or download a new image and display that, resized. We use the getElementById() method to access the data associated with that image, in this case the image dimensions. The browser can be made to display an image in dimensions that aren’t the actual size of the image. Because of this, it is possible to change the image dimensions dynamically.

<html>
<head>

<script type="text/javascript">
function moveover() {
document.getElementById('image').width="200";
document.getElementById('image').height="360";
}

function moveback() {
document.getElementById('image').width="100";
document.getElementById('image').height="180";
}
</script>

</head>

<body>

<b>Mouse over the image:</b><br />
<img id="image" src="bulbon.gif" onmouseover="moveover()" onmouseout="moveback()">

</body>
</html>


A few things have to be considered if you’re going to resize images. The first is simple page layout. If you use a table that contains the image to be resized, you’d alter the entire table upon the resize. Most of the time this isn’t what you want, so it is sometimes prudent to account for the new image dimensions. Within the TD tag of the table, state the size of the TD area as the size of the largest image dimension. This way the table isn’t altered with an oversized image and the page looks as you intended.
I do not employ cookies or tracking devices of any kind