SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Member
    Join Date
    Nov 2001
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Is there a dropdown/flyout menu script that works without absolute positioning?

    The task: I need to add flyout submenus to an existing table of links. There are six links arranged vertically, and the bottom two need submenus to flyout on a mouseover. Seems (like most projects) simple enough.

    The catch: The table containing these links is not absolutely positioned on the page. It is contained in a right-column cell of another table, which is centered on the page. Depending on the window width, the table of links can have any possible left position on the page. The pre-written menu scripts I've found depend on absolute positioning of the main menu as well as the submenus generated by it.

    The problem: I've had a little success modifying a script to use relative positions for the submenus (so they flyout to the left of the main menu, whatever left position it has), but there are two problems:

    [list=1][*]First, it seems that NS4 (which I need to accomodate, at least for Win) will only recognize an absolutely positioned element as a layer, so relatively positioned submenus don't show up.[*]Second, the script uses mouse x and y position to check whether the pointer is over a submenu, in order to keep it open until the mouse leaves its area. But without an absolute position, the submenu returns values of 0 for top/left position and width/height. This results in the submenu disappearing when you point to it, as the script checks mouse position against 0,0.[/list=1]
    The question: Am I just screwed here? Is there a script that will work? Thank you for any help!

  2. #2
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi geetar,

    1) you can try ilayers:

    <td><ilayer id='x' style="position:relative...."><layer id='x1' style='position:absolute; top:0l;left:0'......><div id='.....>

    The ilayer does not require absolute positioning and you can position the layer absolutely within it. remember the accessing will require:
    document.layers[ilayerID].document.layers[layerID]....

    2) you can search www.javascript.faqts.com

    Vinny
    Where the World Once Stood
    the blades of grass
    cut me still

  3. #3
    SitePoint Member
    Join Date
    Nov 2001
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Vinny! I hadn't come across ilayers before, and a search for more info on them led me to a script which provided a solution. Not exactly what I was going for but a more than adequate compromise. Works in Win IE 4, 5 and 6, and NS4, which are the targets.

    However, I thought that layers had been dropped in favor of divs. Is this true of ilayers as well?

    Thanks again. Btw the link you posted couldn't be found.

  4. #4
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi geetar,

    try: http://www.faqts.com -- right hand side, mid-page -- the javascript knowledge base

    re: ilayer being dropped -- yes that is true; however so is the layer tag -- and both are and still will be used by Netscape 4+ (until the last one vanishes from the earth -- remember a new toy train doesn't always run on an old track

    Vinny
    Where the World Once Stood
    the blades of grass
    cut me still

  5. #5
    What? Maelstrom's Avatar
    Join Date
    Oct 2001
    Location
    Whistler BC originally from Guelph Ontario
    Posts
    2,175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you are only creating for ns4.7 then ilayer will work. But as far as I know ilayer is not supported by ANY other browsers.

    you said it worked in IE and netscape 6.0...strange. NM then
    Maelstrom Personal - Apparition Visions
    Development - PhP || Mysql || Zend || Devshed
    Unix - FreeBSD || FreeBsdForums || Man Pages
    They made me a sitepoint Mentor - Feel free to PM me or Email me and I will see if I can help.

  6. #6
    SitePoint Member Variable's Avatar
    Join Date
    Nov 2001
    Location
    Mississippi, USA
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you've still not solved the problem, you might want to look at http://www.dynamicdrive.com/. I haven't looked for what you're specifically asking for, but there's a good chance you could find it there. Hope that helps.
    i - p o r t f o l i o |-[ X/pression [LTN] | B & B H | Renegade Online ]
    c o n t a c t i n g |-[ cyph0r@bellsouth.net | Variable K Cubed | PM ]

  7. #7
    SitePoint Enthusiast
    Join Date
    Mar 2001
    Location
    San Jose, California
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Geetar,
    Give this one a look.It has an example with a text link.
    Relative to mouse position popup menu.
    http://www.simplythebest.net/info/dhtmscript38.html

  8. #8
    SitePoint Addict
    Join Date
    Nov 2000
    Posts
    224
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    More Drop Down Menus

    I have been playing around with a few menu systems but haven't found one that will sit in one frame and display the chosen pages in another frame, has anyone seen one of these?

    I have been playing around with HierMenu (http://www.webreference.com/dhtml/) But when this is in a frame the frame has to be larger that the length of the drop down part other wise it cuts it off.

    Any sugestions?

  9. #9
    SitePoint Member
    Join Date
    Nov 2001
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Vinny - thanks, faqts.com is very helpful. Maelstrom - the script uses SPANs in the ilayer and layer tags, which are what IE uses for the positioning (as far as I can tell). Variable - dynamicdrive is where I got the script. Thanks! Judge - thanks for the suggestion. The script I used does capture mouse position, but also uses other values to make the all the dropdowns have the same offset from the main menu (rather than varying with mouse position). Tezdread - I think dynamicdrive had some scripts that dealt with frames, but I think there's no way that a dropdown can extend outside of its own frame, so the frame has to be tall (or wide) enough to accomodate the dropdown.

    Thanks again for all the suggestions!

  10. #10
    SitePoint Addict
    Join Date
    Nov 2000
    Posts
    224
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice one geetar, gave up on the idea after testing a lot of scripts now I'm trying to customise the script that I have so it moves when I scroll down the page. There was a good script on dynamic drive that does this but it is only a 2 level menu and i need it to expand more than that.

    I'll keep trying and if I get it to work post up the results.


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
  •