473,473 Members | 2,185 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

extend behavior to congruent div

Ok, I've got a div, and it has an onMouseOver handler attached to it
which makes a second div visible. The second div shares part of one side
with the first, but not all.

The first div also has an onMouseOut handler which, you guessed it,
makes the second div invisible.

However, if the user rolls out of the first div and into the second, I'd
like to keep the second div visible.

Any ideas how to accomplish this?

stedae
Jul 23 '05 #1
5 1230
In article <sd*****************************@netnews.comcast.n et>,
Steven Daedelus <sd*******@ira.gov> wrote:
Ok, I've got a div, and it has an onMouseOver handler attached to it
which makes a second div visible. The second div shares part of one side
with the first, but not all.

The first div also has an onMouseOut handler which, you guessed it,
makes the second div invisible.

However, if the user rolls out of the first div and into the second, I'd
like to keep the second div visible.

Any ideas how to accomplish this?

stedae


As so often happens, I answered my own question moments after posting
this.

To any who are interested, the solution is very simple: put the same
handlers and second div.

stedae
Jul 23 '05 #2
Lee
Steven Daedelus said:

Ok, I've got a div, and it has an onMouseOver handler attached to it
which makes a second div visible. The second div shares part of one side
with the first, but not all.

The first div also has an onMouseOut handler which, you guessed it,
makes the second div invisible.

However, if the user rolls out of the first div and into the second, I'd
like to keep the second div visible.

Any ideas how to accomplish this?


Rather than making the second div invisible immediately,
the onmouseout handler of the first div schedules it to
happen after a very short delay (50ms?) using setTimeout().
The onmousover handler of the second div cancels that
scheduled event, using clearTimeout().

Jul 23 '05 #3
In article <c9*********@drn.newsguy.com>,
Lee <RE**************@cox.net> wrote:
Steven Daedelus said:

Ok, I've got a div, and it has an onMouseOver handler attached to it
which makes a second div visible. The second div shares part of one side
with the first, but not all.

The first div also has an onMouseOut handler which, you guessed it,
makes the second div invisible.

However, if the user rolls out of the first div and into the second, I'd
like to keep the second div visible.

Any ideas how to accomplish this?


Rather than making the second div invisible immediately,
the onmouseout handler of the first div schedules it to
happen after a very short delay (50ms?) using setTimeout().
The onmousover handler of the second div cancels that
scheduled event, using clearTimeout().


I tried that. For some reason the timeout was creating all sorts of
weird behaviors besides the one I wanted. But in any case, as my
subsequent post points out, it's not necessary. I discovered that
putting the same handlers on the second div works just fine.
Jul 23 '05 #4
Lee
Steven Daedelus said:

In article <c9*********@drn.newsguy.com>,
Lee <RE**************@cox.net> wrote:
Steven Daedelus said:
>
>Ok, I've got a div, and it has an onMouseOver handler attached to it
>which makes a second div visible. The second div shares part of one side
>with the first, but not all.
>
>The first div also has an onMouseOut handler which, you guessed it,
>makes the second div invisible.
>
>However, if the user rolls out of the first div and into the second, I'd
>like to keep the second div visible.
>
>Any ideas how to accomplish this?


Rather than making the second div invisible immediately,
the onmouseout handler of the first div schedules it to
happen after a very short delay (50ms?) using setTimeout().
The onmousover handler of the second div cancels that
scheduled event, using clearTimeout().


I tried that. For some reason the timeout was creating all sorts of
weird behaviors besides the one I wanted. But in any case, as my
subsequent post points out, it's not necessary. I discovered that
putting the same handlers on the second div works just fine.


That may not be true in all browsers. In some, the second
div may pop down before it can take focus.

Jul 23 '05 #5
In article <c9*********@drn.newsguy.com>,
Lee <RE**************@cox.net> wrote:
Steven Daedelus said:

In article <c9*********@drn.newsguy.com>,
Lee <RE**************@cox.net> wrote:
Steven Daedelus said:
>
>Ok, I've got a div, and it has an onMouseOver handler attached to it
>which makes a second div visible. The second div shares part of one side
>with the first, but not all.
>
>The first div also has an onMouseOut handler which, you guessed it,
>makes the second div invisible.
>
>However, if the user rolls out of the first div and into the second, I'd
>like to keep the second div visible.
>
>Any ideas how to accomplish this?

Rather than making the second div invisible immediately,
the onmouseout handler of the first div schedules it to
happen after a very short delay (50ms?) using setTimeout().
The onmousover handler of the second div cancels that
scheduled event, using clearTimeout().


I tried that. For some reason the timeout was creating all sorts of
weird behaviors besides the one I wanted. But in any case, as my
subsequent post points out, it's not necessary. I discovered that
putting the same handlers on the second div works just fine.


That may not be true in all browsers. In some, the second
div may pop down before it can take focus.


Ah. Good point. I'll check that out.
Jul 23 '05 #6

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

Similar topics

2
by: sdhyok | last post by:
I think the two script should produce the same results, but not. Why? ---------------- Script #1 ls = ls.extend() print ls -> --------------- Script #2
2
by: zig | last post by:
Is there a way to extend the time an alt or title window appears in IE? Or is there a way to use css to control that element and it's appearance? Thanks, Steve.
1
by: Mike Chamberlain | last post by:
Hi all. I'm trying to extend the Microsoft Enterprise Library Data Access Application Block (http://msdn.microsoft.com/library/en-us/dnpag2/html/daab.asp?frame=true) to work with a Borland...
10
by: Jerzy Karczmarczuk | last post by:
Gurus, before I am tempted to signal this as a bug, perhaps you might convince me that it should be so. If I type l=range(4) l.extend() l gives , what else... On the other hand, try
2
by: Boobie | last post by:
I switched to using this function to create element: ---------------------------------------------------- function elem(name, attrs, style, text) { var e = document.createElement(name); if...
4
by: Ivor Somerset | last post by:
Dear CSS community, The code below shows my problem. I have a containing DIV box into which I place floating boxes. As the background-color shows, the size of the containing box is not extended...
3
by: jacobstr | last post by:
I've noticed Object.extend used in a few different ways and I'm having trouble distinguishing why certain usages apply to a given situation. On line 804 Ajax.Base is defined as follows: ...
3
by: kent | last post by:
Hi, For the code below, only "aaa" has a red background but "bbb" and "ccc" don't have it: <div style="background: red">aaa <div style="float:left">bbb</div> <div...
1
by: Jeremy S. | last post by:
I'm implementing logging via the TraceSource class and related TraceSwitch and TraceListeners classes. The TextWriterTraceListener does much of what I need. But it does not roll the log over at...
6
by: Ioannis Papadopoulos | last post by:
I would like to extend the functionality of all streams in C++ so I can do some fancy stuff like redirecting the streams on the fly. I don't want to reimplement the whole stream support in C++...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.