472,803 Members | 1,012 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,803 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 6503
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: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.