473,326 Members | 2,076 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

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?
Jul 23 '05 #1
2 6528
news.west.cox.net wrote:
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?

onload=function(){ div1.onmouseover=function(){//do stuff with div2}}

or <a... onmouseover="afunction();anotherfunction();">

Mick
Jul 23 '05 #2

"Mick White" <mw***********@rochester.rr.com> wrote in message
news:uq****************@twister.nyroc.rr.com...
news.west.cox.net wrote:
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?

onload=function(){ div1.onmouseover=function(){//do stuff with div2}}

or <a... onmouseover="afunction();anotherfunction();">

Mick


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.getElementByID("SubMenuItem");
var mm = document.getElementByID("MainMenuItem");
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

Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Charles Eubanks | last post by:
The enclosed html snippet displays an area map. The behavior I want is for each area to show up (eg show the outline of the poly) when the user mouses over it. This happens nicely BUT in order...
4
by: laurie | last post by:
Hi. I have a DIV section that has many thumbnail images inside it. I have a DIV so all images can fit in a row and the horizontal scroll bar is used to move the thumbnails from left to right. ...
7
by: Richard | last post by:
I know I can have like <a href="#" onclick="dothis" onmouseover="dothat"> But how do you properly code two mouseover's in one statement? <a href="#" onmousever="dothis" onmouseover="dothat"> As...
7
by: windandwaves | last post by:
Hi Gurus I am trying to make this rather complicated maps with an a huge number of mouseovers and the like. I want to set up a function that OnMouseDown swaps the OnMouseOver and OnMouseOut for...
1
by: gordingin | last post by:
The best way to describe my problem is to show some code.... public class Test { int a; public Test() { } }
3
by: drjackk | last post by:
Hello, I'm trying to change the onmouseover event dynamically. This sets-up the initial onmouseover event: <a href="home.html"> <img border="0" id="img22" src="images/home1.jpg"...
2
by: MrCode2k | last post by:
Hello, Trying to do: I just want a table that I can scroll and that has fixed headers. Problem: I got it to work but when I added the onmouseover event it didn't work anymore....
7
by: MrCode2k | last post by:
Hello, Trying to do: I just want a table that I can scroll and that has fixed headers. Problem: I got it to work but when I added the onmouseover event it didn't work anymore....
1
by: den2005 | last post by:
Hi everybody, I am confused and still looking why this codes is not working. Can anyone notice or know why this code is not working? Thanks in advance. Code working: <form id="form1"...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.