Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 7th, 2004, 11:45 PM
Authorized User
 
Join Date: Oct 2003
Location: , , .
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
Default Imar - Please look at this

This is about as simple as I can make it. If you look at this with 800x600 it looks perfect. If you switch to 1024x768 it's not right. I enclosed this in the script you gave me but I'm still not getting it right. Maybe I'm not coding the <applet> correctly. Anyway, getting close..need your help, please.

[code<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
    <title>Test Full Width</title>
    <style type="text/css">
    #MenuWrapper
    {
        float: left;
        width: 150px;
    }

    #Menu
    {
        padding: 40px 0 50px 10px;
        list-style: none;
        margin: 0;
        line-height: 22px;

    }

    #Menu ul
    {
        padding: 0 0 0 14px;
        list-style: none;
        margin: 0;
    }

    #Menu li a
    {
        margin: 0;
        padding: 0 4px 0 0;
        padding-left: 14px;
    }

    #MainContent
    {
        padding: 40px 10px 0 0;
        margin: 0 0 0 0;
    }
    </style>
</head>
<body>

<div id="MenuWrapper">
    <ul id="Menu">
        <li><a href="http://www.networkdriven.com/" id="default">vvvvvvitem 1</a></li>
        <li><a href="#" id="default">vvvvvitem 2</a></li>
        <li><a href="#" id="default">vvvvitem 3</a></li>
    </ul>

</div>
<div id="MainContent">
    <div id="ContentArea">

<img src="../hard-disk7.jpg" width="400" height="310">

    </div>
</div>
</body>
</html>
[/code]

Rudy
__________________
Rudy
Reply With Quote
  #2 (permalink)  
Old July 8th, 2004, 04:27 AM
Imar's Avatar
Wrox Author
Points: 72,019, Level: 100
Points: 72,019, Level: 100 Points: 72,019, Level: 100 Points: 72,019, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,075
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi Rudy,

First of all, your doctype doesn't look good. It should look like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

When I run the page, I see nothing but the menu because I don't have the .zip file for the Java Applet. What is the applet supposed to do? Do you really need applets? If I were you, I'd consider dropping the applet and use plain XHTML, CSS and JavaScript.
Also, the applet has a fixed width so it won't resize.

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
  #3 (permalink)  
Old July 8th, 2004, 11:36 AM
Authorized User
 
Join Date: Oct 2003
Location: , , .
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
Default

 
Quote:
quote:[First of all, your doctype doesn't look good. It should look like this:
Quote:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


I changed this in my original post code.

 
Quote:
quote:When I run the page, I see nothing but the menu because I don't have the .zip file for the Java Applet. What is the applet supposed to do? Do you really need applets? If I were you, I'd consider dropping the applet and use plain XHTML, CSS and JavaScript.
Quote:
Also, the applet has a fixed width so it won't resize.
I removed the applet and inserted an image. You will not see the image but should see it's outline. What I am wanting to do here is end up with the image centered on the page, between the menu on the left and the right margin of the screen. Then changed to different screen resolutions and it should look positioned correctly at whatever resolution I set my screen to.

If you cut and paste my post with the code, I have made the changes that I mentioned above.

Rudy
Reply With Quote
  #4 (permalink)  
Old July 8th, 2004, 11:55 AM
Imar's Avatar
Wrox Author
Points: 72,019, Level: 100
Points: 72,019, Level: 100 Points: 72,019, Level: 100 Points: 72,019, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,075
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Add the following CSS selector to your <style> tag:

#ContentArea
{
  text-align:center;
}

Chis will center the contents of the <div> with an id of ContentArea.
No matter how large you make your screen size, the image will be centered between the menu and the right edge of the browser.

Is this what you're after?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
  #5 (permalink)  
Old July 8th, 2004, 12:28 PM
Authorized User
 
Join Date: Oct 2003
Location: , , .
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes, Yes, Yes!

Imar, that did the trick. Checked with several different resolution settings and it looks great in every one.

Thanks for all your help :)

Rudy
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question for Imar aspcoder BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 22 April 28th, 2008 02:40 PM
Imar! help me shankhan Dreamweaver (all versions) 1 March 20th, 2005 05:45 PM
To Imar: Re: Sub Main shadowpug VB.NET 2002/2003 Basics 1 July 26th, 2003 02:54 PM



All times are GMT -4. The time now is 08:31 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.