Results 1 to 2 of 2

Thread: HV menu shifts at different screen resolutions

  1. #1
    Join Date
    Feb 2006
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default HV menu shifts at different screen resolutions

    1) Script Title:
    HV menu

    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...menu/index.htm

    3) Describe problem:
    I am having problem getting this menu positioned correctly. Actually, with my computer screen set at 800x600 pixels, the position is great (as I have it defined in the exmplmenu.js file). But when I adjust my screen to 1024x768 (to see how it will look on other people's screens), this menu is shifted to the left - not where I want to to be positioned. I have the code placed directly below the <body> tag, as instructed. Do you know what I must do in order to get the menu to be positioned correctly (more-or-less centered within the page) for all screen resolutions? Perhaps some of my other code is interfering...Thank you.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    In the documentation for this menu, in the config.htm that comes with the distribution archive, this is a little more than halfway down the page:

    originally from - HVmenu config.htm (Explanation of exmplmenu_var.js file):

    TargetLoc
    Text string- Enables relative positioning of the menu.
    1- In the HTML-file where the menu shows you need a named div:
    <div id='MenuPos' style='position:relative'></div>
    2- Set TargetLoc to 'MenuPos'
    3 - Set MenuCentered to 'left', MenuVerticalCentered to 'top' and StartTop and StartLeft to 0
    4 - StartTop, StartLeft and the Menu center variables can still be used to get an offset from the <div>.

    Remarks: the different ways browsers interpret the pageX and pageY offset makes this feature difficult. I got the best results by putting the div inside a table, give the div the same dimensions as the first level menu, put an transparent image inside the div with again the same dimensions as the first level menu
    <table>
    <tr><td>
    <div id='MenuPos' style='position:relative; width:102; height:102;'><img src='transparent.gif' width='102' height='102'></div>
    </td></tr>
    </table>
    It's a little tricky but, it works in most cases. What this then does is allow you to center or otherwise position and set dimensions for the containing table as you would any other normal element.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

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