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 PDF 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
preload an image

Image preloading is as essential skill that you’ll use repeatedly. Consider this: you’ve loaded your page and have a menu system that uses images that change as the mouse floats over them. Once the page is loaded the user does so, but there is a lag between the mouse passing over that area and the new image being displayed. This is because the browser has to fetch the new image and display it. This lag can be eliminated if you preload the image into a variable as the page loads and trigger its display as the mouse floats over it. The process is essentially immediate and is a great affect.

<html>
<head>

<script type="text/javascript">
img2=new Image();
img2.src="landscape3.gif";
function changeImage() {
document.getElementById('myImage').src=img2.src;
}
</script>

</head>

<body>

<p>When you mouse over the image, a new image will appear.</p>
<img id="myImage" onmouseover="changeImage()" width="160" height="120" src="landscape2.jpg">
<p>The new image appears instantly, because your browser has already loaded the image.</p>

</body>
</html>


We use an onMouseOver event to trigger the JavaScript function that is stated in the HEAD of the document. The original image is displayed until the mouse floats over it. The new image is then displayed. Note that if you’d like to change back to the original image you’d have to provide a different function name with the original file name and trigger it with an onMouseOut event.
I do not employ cookies or tracking devices of any kind