PDA

View Full Version : Links only working first time around.


Letter A
08-26-2009, 10:23 AM
evrytime i add links on my site that im trying to create, I have to go through this hell. Ill link up the image or text, then during previewing, or if I publish the site the link may work once but then if you click on it after that it just adds a hash mark to the URL. What im saying might make more sense if you go to my site http://www.letter-adesign.com/Print1.html# Ive linked the MOTION, button to take you to the page containing my Motion work, it will work 1st time around but then if you click back on PRINT and try and return to the Motion page for some reason it refuses to work. if you try and enter the page from my sitemap tho. It does work. The same thing happens from my LOGO page.

Plus Link checker says everything is A-ok. Im using dreamweaver CS4 on a Mac and previewing in Safari and Firefox.

Please help im tearing my hair out trying to figure this out.
Heres the ode from my Print.html page, the first few lines of code I cant change as Im using a template I made based on my sitemap:



<!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"><!-- InstanceBegin template="/Templates/sitemap.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Letter A Design</title>
<!-- InstanceEndEditable -->
<link href="Logo1.html" rel="stylesheet" type="text/css" />
<link href="Container2.css" rel="stylesheet" type="text/css" />
<link href="Right Sidebar 2.css" rel="stylesheet" type="text/css" />
<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[i])&&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[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].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[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<link href="Mainbody2.css" rel="stylesheet" type="text/css" />
<!-- InstanceBeginEditable name="head" -->
<style type="text/css">
<!--
#apDiv1 {
position:absolute;
width:409px;
height:517px;
z-index:1;
left: 512px;
top: 26px;
}
-->
</style>
<script src="SpryAssets/SpryEffects.js" type="text/javascript"></script>
<script type="text/javascript">
<!--
function MM_effectAppearFade(targetElement, duration, from, to, toggle)
{
Spry.Effect.DoFade(targetElement, {duration: duration, from: from, to: to, toggle: toggle});
}
//-->
</script>
<!-- InstanceEndEditable -->
</head>

<body onload="MM_preloadImages('Letter A Logo Colour.jpg','Yellow Line.jpg','Blue Line.jpg','Pink line.jpg','Letter A Logo Colour.jpg')">
<div class="Container"><!-- InstanceBeginEditable name="Rightsidebar2" -->
<div class="Leftsidebar2">
<p><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('HOME','','Letter A Logo Colour.jpg',1)"></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('HOME','','Letter A Logo Colour.jpg',1)"></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a href="http://www.letter-adesign.com/#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('HOME','','Letter A Logo Colour.jpg',1)"><img src="Letter A Logo.jpg" name="HOME" width="133" height="133" border="0" id="HOME" /></a></p>
</div>
<!-- InstanceEndEditable --><!-- InstanceBeginEditable name="MainBody2" -->
<div class="MainBody2">
<p>&nbsp;</p>
<p><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Advertising','','Yellow Line.jpg',1)"><img src="Advertising.jpg" name="Advertising" width="258" height="62" border="0" id="Advertising" /></a></p>
<p><a href="Motion2.html"><img src="Motion.jpg" name="Motion" width="173" height="51" border="0" id="Motion" /></a></p>
<p><a href="Print1.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Print','','Blue Line.jpg',1)"><img src="Print.jpg" name="Print" width="122" height="57" border="0" id="Print" /></a></p>
<p><a href="Logo1.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Logo','','Pink line.jpg',1)"><img src="logo.jpg" name="Logo" width="144" height="41" border="0" id="Logo" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp; </p>
<table width="95%" border="0">
</table>
</div>
<!-- InstanceEndEditable --><!-- InstanceBeginEditable name="lEFT" -->
<div class="RightSidebar2">
<div id="apDiv1">
<p><img src="YMOTY Poster Flat.jpg" alt="Print 1" width="432" height="611" onload="MM_effectAppearFade('apDiv1', 2000, 0, 100, false)" /></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><img src="Back of Card YMOTY Web.jpg" width="508" height="319" alt="Business Card" /></p>
<p>&nbsp;</p>
<p><img src="YMOTY Back of Card WEB.jpg" width="513" height="329" alt="Back Of business Card" /></p>
</div>
</div>
<!-- InstanceEndEditable --></div>
<span class="RightSidebar2"></span>
</body>
<!-- InstanceEnd --></html>

domedia
08-26-2009, 06:16 PM
You are using links with '#' as the value in the href attribute. So you're creating fake links hat do not go anywhere and this is what's creating the change of url.

The solution is to stop using links as the area where you do your rolleovers and put the imageswap right on the image itself..