Need help with a Dreamweaver rollover image/imagemap?

  • Thread starter Thread starter Miss Dark
  • Start date Start date
M

Miss Dark

Guest
Hello... I'm creating a website at the moment, and have much experience with Dreamweaver.

My rollover image also serves as an imagemap (takes you to a link by clicking on the image).

However, when I copy the exact code from dreamweaver into my website, the image does not show up! Only the alt text will show up, and if i click the link I get a 'page can not be displayed' message.

I have opened the file itself in Firefox, IE, and Chrome and there's no issues.

Here is the code I have:

<head>
<style type="text/css">
h2 {text-align: center; color: #996633;}
p {font-family: Georgia, Helvetica, sans-serif; margin: 20px; color: #3399cc; text-align: word-wrap;}
body {background-color: black;}
</style>
<script type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}}
}

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
//-->
</script>
</head>





<body onload="MM_preloadImages('../Pictures/Photoshop Goodness/Zeus.jpg')">
<p><a href="../Documents/School/Web Programming/Data Files/10pageXHTMLsite/training2.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Boxersit1','','../Pictures/Photoshop Goodness/Zeus.jpg',1)"><img src="../Pictures/Photoshop Goodness/boxer_image3.jpg" alt="Boxer learning to Lay Down" name="Boxerlay1" width="200" height="150" border="0" id="Boxerlay1" /></a></p>


Thank you in advance!
 
Way I see it, you need to set your image paths here.

<body onload="MM_preloadImages('../Pictures/Ph… Goodness/Zeus.jpg')">
<p><a href="../Documents/School/Web Programming/Data Files/10pageXHTMLsite/training2.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Boxersit1',''… Goodness/Zeus.jpg',1)"><img src="../Pictures/Photoshop Goodness/boxer_image3.jpg" alt="Boxer learning to Lay Down" name="Boxerlay1" width="200" height="150" border="0" id="Boxerlay1" /></a></p>

If you already did that and saved it (wherever), I do believe this is where you gone wrong.

'..' means back a directory. usually in windows, the starting point is at the C drive, which would be 'C:\'.

of course, there are work arounds for this but my recommendation is to install a locahost and work from that so you don't have to write a full path from the C:\ drive.
 
Back
Top