dreamweaver allignment problem!!!

compfix

New Member
Hi,

I'm still new to dreamweaver so I got stuck on this "simple" item.

I have a rollover button, which is fine I draw it wherever I want to have it located and everything is working fine BUT as soon as I want the whole website to be <center> (centered) it will center the web for me BUT also my BUTTON!?!?!- What am I doing wrong that the button goes with the page. How can I make it happen so it will stay at the original location.

little bit about button:

><img src="button/contact_button.png" name="Image2" width="219" height="61" border="0" align="right" id="Image2" /></a></div>


button_problem.png
 

compfix

New Member
friends here is your request:




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0014)about:internet -->
<html xmlns="http://www.w3.org/1999/xhtml">
<div align="middle">
<head>
<title>design_site</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!--Fireworks CS5 Dreamweaver CS5 target. Created Fri Nov 12 00:33:30 GMT-0600 (Central Standard Time) 2010-->
<script type="text/javascript">
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_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_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>
<style type="text/css">
#apDiv1 {
position:absolute;
left:756px;
top:502px;
width:177px;
height:26px;
z-index:1;
}
</style>
</head>
<body bgcolor="#ffffff" onload="MM_preloadImages('button/contact_button_after.png')">
<div id="apDiv1"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image2','','button/contact_button_after.png',1)"><img src="button/contact_button.png" name="Image2" width="219" height="61" border="0" align="right" id="Image2" /></a></div>
<img name="design_site" src="design_site.gif" width="1024" height="1000" border="0" id="design_site" alt="" />
</body>
</html>
<div align="middle">
 

compfix

New Member
the alignment problem happens when I try to center the website for the browsers-that's when the rollover button changes its place..... It doesn't make sense I thought that dreamweaver will do better than that..... I know there is a my small mistake somewhere in this scenario..... Pleas let me know.
 

smoovo

New Member
First stop blame Dreamweaver for your non working script, it doesn't make any sense...

Now, your JS script not correct at all, that's the reason you getting bugs. Let's start with the function "MM_swapImage()", it doesn't get any variables with it, and your onmouseover sends it... "MM_swapImage('Image2','','button/contact_button_after.png',1)"

Go over your script and check everything in it, also the JS.

- Enjoy.
 
Top