473,466 Members | 1,511 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

onmouseover and onmouseout event

I would like to get a little window (101x73) to appear on onmouseover and
go away onmouseout. the onclick works.
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>

<body>

<div onclick="alert('testing')">testing mouseover</div>

</body>

</html>
Jul 23 '05 #1
7 3218
"Samir" <sa***@hotmail.com> wrote in message news:Xn*****************************@63.218.45.41. ..
I would like to get a little window (101x73) to appear on onmouseover and
go away onmouseout. the onclick works.


<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>

<body>

<div onclick="alert('testing')">testing mouseover</div>

</body>

</html>


You are not caputuring the onmouseover or onmouseout events. What you have captured is the onclick event. And then you get a modal dialog box which requuires action before anything else in the page fires. What you want is something like this:

<div onmouseover="javascript:tester=window.open('testin g.htm','test','width=101,height=100');" onmouseout="tester.close();">Try this</div>

I believe 100x100 is the smallest window you can make this way.
Jul 23 '05 #2
Ivo
"George Hester" <he********@hotmail.com> wrote:
"Samir" <sa***@hotmail.com> wrote:
I would like to get a little window (101x73) to appear on onmouseover
and go away onmouseout.


<div

onmouseover="javascript:tester=window.open('testin g.htm','test','width=101,h
eight=100');" onmouseout="tester.close();">Try this</div>

I would suggest using a special division which you show and hide by
manipulating its style (visibility or display property) or className,
instead of a separate window. It is an ordinary <div> tag, can be any size,
also smaller than 100x100, and is not sensitive to pop-up blocking software.
More importantly, drop the "javascript:" pseudo-protocol from the
onmouseover event handler. They are not the place for specifying the type of
script, you do that with a http header of meta tag. Most browsers will
ignore it and run the script anyway, but they are not required to do so.
--
Ivo
Jul 23 '05 #3
"Ivo" <no@thank.you> wrote in message news:41***********************@news.wanadoo.nl...
"George Hester" <he********@hotmail.com> wrote:
"Samir" <sa***@hotmail.com> wrote:
I would like to get a little window (101x73) to appear on onmouseover
and go away onmouseout.


<div

onmouseover="javascript:tester=window.open('testin g.htm','test','width=101,h
eight=100');" onmouseout="tester.close();">Try this</div>

I would suggest using a special division which you show and hide by
manipulating its style (visibility or display property) or className,
instead of a separate window. It is an ordinary <div> tag, can be any size,
also smaller than 100x100, and is not sensitive to pop-up blocking software.
More importantly, drop the "javascript:" pseudo-protocol from the
onmouseover event handler. They are not the place for specifying the type of
script, you do that with a http header of meta tag. Most browsers will
ignore it and run the script anyway, but they are not required to do so.
--
Ivo



Yeah actually it should have been something like this:

<div onmouseover="tester=window.open('testing.htm','tes t','width=101,height=100');" onmouseout="self.close();">Try this</div>

Although your suggestion of using a <DIV and CSS is commendable it is not what the op asked for. I believe it is
constructive to provide what ops ask for first then if you have the time move on and provide what you think is a
better solution. Of course that's just me. No matter how poor a op's desire may be in the eyes of an expert it is
good ettiquete to provide what is asked for if you know how to do it. The op can learn later if they want
alternative solutions. Sometimes we learn by our mistakes. Sometimes not. But that is the ops lesson to learn for
him or her self. Please do not fly off the handle for what I've said. It's just a suggestion.

--
George Hester
__________________________________
Jul 23 '05 #4
George Hester wrote:
[...]
Although your suggestion of using a <DIV and CSS is commendable it is not what the op asked for. I believe it is
constructive to provide what ops ask for first then if you have the time move on and provide what you think is a
better solution. Of course that's just me. No matter how poor a op's desire may be in the eyes of an expert it is
good ettiquete to provide what is asked for if you know how to do it. The op can learn later if they want
alternative solutions. Sometimes we learn by our mistakes. Sometimes not. But that is the ops lesson to learn for
him or her self. Please do not fly off the handle for what I've said. It's just a suggestion.


If you took the time to provide advice to someone who didn't ask for
it, you should have provided the advice to the person that did in the
first place.

Your sample code (if it opens a pop-up at all) will close the parent
window - not the child. Either way, your div sets a trap that does
things to a users interface that they will likely get very frustrated
trying to deal with. I didn't read where Samir asked "Please let me
really annoy my visitors", so please provide full advice if you are
going to assist with creating very unreliable and annoying UI
"features".

And last I knew, Samir was a mans name so it's fine to refer to "him".

Cheers, Zif.
Jul 23 '05 #5
I was more wanting an effect like ie....you know when you have a text or
picture and you can have an option of putting some caption on it...well I
would like to have that happen when the mouse is over the text it opens a
caption like thing to show another htlm page or something like that.

thanks.
Jul 23 '05 #6
George Hester wrote:
<snip>
<div
onmouseover="tester=window.open
('testing.htm','test','width=101,height=100');"
onmouseout="self.close();">Try this</div> <snip>... . No matter how poor a op's desire may be in
the eyes of an expert it is good ettiquete to
provide what is asked for if you know how to do it.

<snip>

So you think that when someone expresses the desire to shoot themselves
in the foot, an appropriate response would be to hand them a loaded gun?
And apparently motivated by some perverse (considering your past
behaviour) notion of politeness?

Fortunately your inability to recognise when someone is trying to shoot
themselves in the foot is somewhat mitigated by your total inability to
load the gun you passed them (The script above is up to your usual
standard i.e. worse than useless even for the stated task).

Richard.
Jul 23 '05 #7
Samir wrote:
I was more wanting an effect like ie....you know when you have a text or
picture and you can have an option of putting some caption on it...well I
would like to have that happen when the mouse is over the text it opens a
caption like thing to show another htlm page or something like that.

thanks.


Then use Ivo's suggestion, often also called "dynamic HTML". Have a
look at <URL: http://www.w3schools.com> for some instruction.

Zif.
Jul 23 '05 #8

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

Similar topics

1
by: christian9997 | last post by:
Hi I was trying to create a page where a SubMenu would appear when the user moved the mouse over an item of a Menu (= Table Cell <TD>). Unfortunately there seems to be a problem; the onMouseOver...
12
by: Epetruk | last post by:
Hi all, I want a page where the contents of a table cell are replaced with an image when the mouse moves over the cell, and the text is restored when the mouse moves out. Here's the html for the...
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...
3
by: Rob Roberts | last post by:
I'm using .NET 2.0 and C# on a web site, and I'm trying to use the onmouseover and onmouseout events to do a rollover effect on an asp.net button. I've tried manually adding the events to the...
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....
3
by: oopaevah | last post by:
I have written some dom code to create a list of divs, each with it's own id. I want to set the onmouseover and onmouseout events to highlight the div when the mouse is over it. However I cannot...
2
by: Daz | last post by:
Hi everyone. I think my problem is a simple one, but I am completely baffled as to how to pull it off. I have a piece of code like so... document.write( "<img id=\"slideshow_toggle\"...
4
by: bgold12 | last post by:
Hey, I have kind of a weird problem. I have a span that I'm intentionally overflowing a table cell (<td>), so that it stretches over the table cells to the right of the parent table cell. I want...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.