Force fake onmouseover

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • news.west.cox.net

    #1

    Force fake onmouseover

    I have been writing a practice sliding div navigation script. I am finding
    myself in the position where I need to force a div into showing the hover
    behavior defined in css.

    So my question is this. If I have two divs, is there a way to make the
    second div display its onmouseover behavior when the mouse is over div 1?


  • Mick White

    #2
    Re: Force fake onmouseover

    news.west.cox.n et wrote:
    [color=blue]
    > I have been writing a practice sliding div navigation script. I am finding
    > myself in the position where I need to force a div into showing the hover
    > behavior defined in css.
    >
    > So my question is this. If I have two divs, is there a way to make the
    > second div display its onmouseover behavior when the mouse is over div 1?
    >
    >[/color]
    onload=function (){ div1.onmouseove r=function(){//do stuff with div2}}

    or <a... onmouseover="af unction();anoth erfunction();">

    Mick

    Comment

    • news.west.cox.net

      #3
      Re: Force fake onmouseover


      "Mick White" <mwhite13BOGUS@ rochester.rr.co m> wrote in message
      news:uqR4e.6806 $uw2.575@twiste r.nyroc.rr.com. ..[color=blue]
      > news.west.cox.n et wrote:
      >[color=green]
      >> I have been writing a practice sliding div navigation script. I am
      >> finding myself in the position where I need to force a div into showing
      >> the hover behavior defined in css.
      >>
      >> So my question is this. If I have two divs, is there a way to make the
      >> second div display its onmouseover behavior when the mouse is over div 1?[/color]
      > onload=function (){ div1.onmouseove r=function(){//do stuff with div2}}
      >
      > or <a... onmouseover="af unction();anoth erfunction();">
      >
      > Mick[/color]

      I understand what you are saying here. But, it is not what I am looking
      for. Let me try to explain better.

      The navigation that I have written uses divs that slide into view when you
      do a rollover on the main navigation bar. So, say someone rolled over the
      first menu item, a div would roll out that shows some sub menu items for
      that main menu item. The div stays visible until you rollout from the main
      menu item or the sub menu. That all works great.

      I have normal css applied to the main menu, so when you roll over an item
      and the sub menu div rolls out, the link appearance changes because there is
      "hover" behavior defined in my css file. When I move my cursor onto the sub
      menu div, the "hover" behavior on the main menu item ceases. That is
      because I am no longer hovering over it.

      What I am looking for is a script to use for the onmouseover event for the
      sliding div. So, when someone is hovering over the div, the main menu item
      displays the hover state as defined by css.

      Does any of this make sense??? I will try to put together a working example.

      Ideally, I would be able to define a var that was say

      ----- pseudo code - not tested -----
      var sm = document.getEle mentByID("SubMe nuItem");
      var mm = document.getEle mentByID("MainM enuItem");
      if (sm.onmouseover == true) {
      mm.onmouseover = true;
      }

      So that I could get the "hover" state to appear for MainMenuItem while the
      mouse is over SubMenuItem.

      Thanks



      Comment

      Working...