Code:
<script type="text/javascript" src="http://www.twey.co.uk/includes/FadableObject.js"></script>
<script type="text/javascript">
function preloadImages() {
for(var i = 0; i < arguments.length; ++i)
(preloadImages.store[preloadImages.store.length] = new Image()).src = arguments[i];
}
preloadImages.store = [];
preloadImages("/path/to/loaded_image.png", "/path/to/mouseover_image.png", "/path/to/timed_image.png");
window.onload = function() {
var e = document.images['header_image'];
new FadableObject(e, 1, 10, 0, 99, false, false);
e.src = preloadImages.store[0].src;
e.onmouseover = function() {
this.fadeThread.fadeOut(function(){
this.element.src = preloadImages.store[1].src;
this.fadeIn();
});
};
e.onmouseout = function() {
function() {
document.images['header_image'].fadeThread.fadeOut(function(){
this.element.src = preloadImages.store[0].src;
this.fadeIn();
});
};
window.setTimeout(
function() {
document.images['header_image'].fadeThread.fadeOut(function(){
this.element.src = preloadImages.store[2].src;
this.fadeIn();
});
},
3000
);
e = null;
};
</script>
</head>
<body>
<h1>
<img src="/path/to/initial_image.png" id="header_image" alt="Header Text">
</h1>
Bookmarks