SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    May 2006
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Horiz. Menu with the DOM

    Anyone know how to test if the mouse is over an ID area?
    In this function I have the sub-menu close if I leave the parent-menu tab. That of course closes the sub menu if I move down on to it. How do I test if I move into that area it is "ok" leave the sub menu visable?
    Thanks in advance!

    function hideChild(source) {
    var changeSource = document.getElementById(source);
    // if cursor in the area of ID homeMenu then DO NOT hide the div
    changeSource.className = "disNone";
    }

  2. #2
    American't awestmoreland's Avatar
    Join Date
    Sep 2002
    Location
    Grand Rapids, MI
    Posts
    1,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Investigate setTimeOut().

    You need to add a short delay after leaving the parent menu before the sub menu disappears. If the mouse enters the sub menu during that delay, then the countdown is aborted.

    I almost wrote an article on this very topic earlier in the week. Perhaps I still should.


    Andy
    From the English nation to a US location.


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
  •