Forum Moderators: open
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>coming_soon</title>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=iso-8859-1" />
<style type="text/css">
body{
margin:0;
padding:0;
}
#test{
position:absolute;
top:100px;
left:300px;
line-height:130px;
width:319px;
height:130px;
overflow:hidden;
text-align: center;
}
#coming_soon{
position:relative;
vertical-align:bottom;
width:319px;
height:260px;
border:none;
}
</style>
</head>
<body bgcolor="#FFFFFF">
<div id="test">
<img id="coming_soon" src="images/coming_soon.png" alt="" usemap="#coming_soon_Map" />
<map name="coming_soon_Map" id="coming_soon_Map">
<area shape="poly" alt="" coords="7,39, 16,10, 22,7, 308,86, 313,92, 302,120, 298,122, 290,122, 12,48, 7,44" href="#" />
</map>
</div>
</body>
</html>
[edited by: incrediBILL at 3:03 pm (utc) on May 26, 2010]
[edit reason] Link to image removed [/edit]
[edited by: tedster at 4:16 am (utc) on May 28, 2010]
[edit reason] fixed the link [/edit]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="language" content="english">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<title>untitled document</title>
<style type="text/css">
body {
margin:0;
padding:0;
background-color:#fff;
}
#test {
width:319px;
margin:100px 0 0 300px;
}
#coming_soon {
display:block;
width:319px;
height:260px;
border:0;
}
</style>
<script type="text/javascript">
function init(){
document.getElementsByTagName('area')[0].onmouseover=function(){
document.getElementById('coming_soon').src='[blue]images/coming_soon[/blue][red]_over[/red][blue].png[/blue]';
this.onmouseout=function() {
document.getElementById('coming_soon').src='[blue]images/coming_soon.png[/blue]';
}
}
}
if(window.addEventListener){
window.addEventListener('load',init,false);
}
else {
if(window.attachEvent){
window.attachEvent('onload',init);
}
}
</script>
</head>
<body>
<div id="test">
<img id="coming_soon" src="[blue]coming_soon.png[/blue]" alt="" usemap="#coming_soon_Map">
<map name="coming_soon_Map" id="coming_soon_Map">
<area shape="poly" coords="7,39,16,10,22,7,308,86,313,92,302,120,298,122,290,122,12,48,7,44" href="#" alt="">
</map>
</div>
</body>
</html>
Can this be adapted to use a single image so there is no rollover delay downloading the 2nd image?
<script type="text/javascript">
function init(){
document.getElementsByTagName('area')[0].onmouseover=function(){
document.getElementById('coming_soon').src='[red]images/coming_soon_over.png[/red]';
this.onmouseout=function() {
document.getElementById('coming_soon').src='images/coming_soon.png';
}
}
}
if(window.addEventListener){
window.addEventListener('load',init,false);
}
else {
if(window.attachEvent){
window.attachEvent('onload',init);
}
}
[blue]
var preloads=[];
function preload(){
for(c=0;c<arguments.length;c++) {
preloads[preloads.length]=new Image();
preloads[preloads.length-1].src=arguments[c];
}
}
preload('[red]images/coming_soon_over.png[/red]');
[/blue]
</script>