SitePoint Sponsor

User Tag List

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

    DIV onmouseover not working in dropdown menu

    Hi everyone,

    I have a menu with some DHTML dropdowns. It's built completely with DIVs, not tables. The DIVs that contain each link have an onmouseover function that changes the background color and border color.

    The problem is that the DIVs in the dropdowns don't perform the onmouseover function unless you're pointing right at the text in the DIV, whereas in the main menu you just have to be pointing anywhere in the DIV. Why is that? They are defined by the same class and use the same function call.

    The page is at http://65.186.11.73/bp2/

    (Right now the code is only for IE5+ PC, so no need to point out that all the JavaScript is IE-specific.) Thanks for any advice!

  2. #2
    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)

    Re: DIV onmouseover not working in dropdown menu

    I had a similar problem with div onmouseovers as well. The only thing I can think of trying it possibly filling the gap with &nbsp. The div may look at that as a character and allow the mouseover to work.

    I realize it is just a quick fix. (if it works)

    [edit]

    Ok that didn't quite look right. Fill is with a non breaking space. & nbsp

    (close the gap between the & and letters )
    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.

  3. #3
    SitePoint Member
    Join Date
    Nov 2001
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Maelstrom, thanks for your reply. That idea occurred to me too. It does work, but I'd like to keep from filling the dropdowns with non-breaking spaces as they're quite wide. I'm just stumped by the logic. Why is it happening at all? The main menu mouseovers work perfectly, and there's nothing to suggest that the dropdowns shouldn't work the same way. The code is the same!


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
  •