SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need help with a menu

    Source: www.commgospel.com

    When you mouseover a nav link a dropdow appears. However mousing off has it disappearing. How can I get the nav to stay open while hovering over it and dissapear on mouseoff (or at least a time delay)?

    Aaron
    Aaron Brazell
    Technosailor



  2. #2
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    First, I'd find an established drop-down menu. They aren't usually as easy as hiding/showing layers.

    However, your first problem is that you have hide() perpetually calling itself.

    I suspect you want something more like this
    Code:
    function hide(id)
    {
       var elem = document.getElementById(id);
       setTimeout(function() { elem.style.display='none';},600);
    }
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  3. #3
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmmm. This still doesn't work. I considered using a premade nav but sojme of the code is so obfuscated I can't figure it out. Also, because the menus are dynamically generated from a database (CMS powering the backend generating these static pages) I found it was hard to tie the 2 together. So back to the drawing board here. Any other ideas?
    Aaron Brazell
    Technosailor



  4. #4
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Alright got it. Stole some ideas from another website that had a nav that functionaLLy did similar to what I was doing and hijacked the javascript to my site. must say, now that I have learned PHP, learning javascript has been much easier. When I first started trying to learn, I only knew HTML and swiped aside js as too complicated and difficult. Now it's alot easier since I know PHP and since the DOM has standardized quite a bit...
    Aaron Brazell
    Technosailor



  5. #5
    Free your mind Toly's Avatar
    Join Date
    Sep 2001
    Location
    Panama
    Posts
    2,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Same here. At least when I look at javascript now, I have an idea of how it works as it is very similar to php.
    Community Guidelines | Community FAQ

    "He that is kind is free, though he is a slave;
    he that is evil is a slave, though he be a king." - St. Augustine


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
  •