Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3

Thread: Help with dhtml

  1. #1
    Junior Member
    Join Date
    Jan 2004
    Posts
    5
    Member #
    4731
    Not sure if this is the right place to put this. We are trying to set our webpage up like this,The Fovea Project, however something is wrong with our code. The page is aligned how we want it in dreamweaver, but when we preview it it comes out all wrong. what we are looking for is to have everything centered in the browser window. like i said, we are using dreamweaver and have all our images placed in layers.

    here is our code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>pink dot design</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function MM_reloadPage(init) { //reloads the window if Nav4 resized
    if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
    else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
    }
    MM_reloadPage(true);

    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_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_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>
    </head>

    <body onLoad="MM_preloadImages('dot2.gif')">
    <div id="Layer6" style="position:absolute; left:21px; top:696px; width:1145px; height:34px; z-index:6">
    <div align="center"><img src="ojbar.gif" width="800" height="22" align="bottom"></div>
    </div>
    <div id="Layer7" style="position:absolute; left:745px; top:234px; width:75px; height:32px; z-index:7">
    <div align="center"><img src="portfolio.gif" width="64" height="10"></div>
    </div>
    <div id="Layer8" style="position:absolute; left:22px; top:686px; width:1146px; height:18px; z-index:8">
    <div align="center"><img src="contact.gif" width="274" height="13"></div>
    </div>
    <div align="center">
    <div align="center"></div>
    <div id="Layer1" style="position:absolute; left:346px; top:180px; width:366px; height:296px; z-index:1"><img src="greenbox1.gif" width="228" height="226"></div>
    <div id="Layer2" style="position:absolute; left:303px; top:170px; width:131px; height:432px; z-index:2"><img src="pinkdot.gif" width="156" height="436"></div>
    <div id="Layer3" style="position:absolute; left:548px; top:421px; width:113px; height:117px; z-index:3"><img src="greenbox3.gif" width="103" height="103"></div>
    <div id="Layer4" style="position:absolute; left:652px; top:321px; width:181px; height:171px; z-index:4"><img src="greenbox2.gif" width="156" height="154"></div>
    <div id="Layer5" style="position:absolute; left:746px; top:176px; width:73px; height:69px; z-index:5"><a href="javascript:;" onMouseOver="MM_swapImage('dot','','dot2.gif',1)" onMouseOut="MM_swapImgRestore()"><img src="dot.gif" name="dot" width="54" height="54" border="0" id="dot"></a></div>
    </div>
    </body>
    </html>


    Thanks a lot!!!!

  2.  

  3. #2
    Senior Member splufdaddy's Avatar
    Join Date
    Feb 2003
    Location
    Boston, MA
    Posts
    4,488
    Member #
    735
    A preview of this site in action would help, so we could see the error ourselves. Saying your site is "all wrong" doesn't really help us.

    Without seeing the error though, I can tell you that you can't center a site in the window using absolute positioning. With absolute positioning, you're telling each layer to start X number of pixels away from the left side of the screen. On different size resolutions, the layers will need to be closer or further away to the left side of the screen.

  4. #3
    Junior Member
    Join Date
    Jan 2004
    Posts
    5
    Member #
    4731
    http://www.gd3design.com/pinkdotdesign/index.htm

    Sorry about that heres the link to what we have so far. Yes we can see what you are talking about regarding the absolute however are not sure how to remedy this. Thanks for your help!!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 09:26 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com