SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Addict mmanders's Avatar
    Join Date
    Jul 2006
    Location
    Edinburgh, Scotland
    Posts
    358
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Intelligent Drop-Down Menu

    I have a pure CSS flyout navigation menu. If this menu is viewed on certain lower resolutions, then the submenu will be clipped by the viewport and disappear of screen. If the user has a scroll wheel they can scroll down the page but this is far from ideal.

    I would like to use some JavaScript to do something like calculate the height of the submenu, determine the height of the viewport and then, if the drop down will go off screen, pop it up the way instead of down the way. DOes that make sense?

    Any suggestions or recommended readnig appreciated!

  2. #2
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So, basically exactly what you said needs to be translated to JavaScript. Do you have any approach so far that you need help with?

  3. #3
    SitePoint Addict mmanders's Avatar
    Join Date
    Jul 2006
    Location
    Edinburgh, Scotland
    Posts
    358
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well I have a reading knowledge of JavaScript and have written a few little bits and bobs for adding rows to tables etc. Is it just a case of looking up the DOM for the various elements involved and working with that or is there more to it?

  4. #4
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, you basically need to do exactly what you said before... You are already on the right track



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
  •