Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2003
    Location
    Spokane, WA
    Posts
    512
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Correctly size JavaScripts...?

    I have a javascript navbar that I have correctly placed in a 1024px resolution according to pixels. I recently realized that when the page is viewed in different resolutions, the nav bar gets all funky. I tried replacing the "100" with a "100%" (like you would do for a table), but that just gave my page a huge error and the script wouldn't load! Does anyone know how I can make a % sized version of this:
    slideMenu.menuy=100 //top placement of the menu

    ????


    I know you can do it in css, but I don't know css. So if the only way to do it is in css, then it would be great if you just provided me with the code instead of telling me to figure it out on my own...

    Thanks!

    -Ben

  • #2
    Regular Coder
    Join Date
    Jan 2003
    Posts
    867
    Thanks
    4
    Thanked 8 Times in 8 Posts
    slideMenu.menuy=screen.width

    I guess a more reasonable size would be screen.width-100 or something.

  • #3
    Regular Coder
    Join Date
    Jun 2003
    Location
    Spokane, WA
    Posts
    512
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Are you sure that will work? I mean, I am working with the vertical placement of this element, not it's width. I know that CSS has to do with the layout of the page, so shouldn't it also control the size of the layout of the page? Or am I mixing layout with content? What I'm trying to ask is this:

    Is there a way to make my nav bar "resize" in proportion with the user's resolution and/or screensize? I not only want the nav bar's size to stay in proportion to the resolution and/or screensize, but I also want the nav bar's position to be in that proportion, too.

    If you need to see a working example of what I mean, go to
    http://www.webpropertiesinc.com and check out the nav bar on the left's source.

    Thanks again!

    -Ben


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •