473,406 Members | 2,956 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,406 software developers and data experts.

onmouseover / onmouseout not working as expected

onmouseover and onmouseout seem only to work half the time in a script
i wrote to fade between different opacities:

http://www.frostjedi.com/terra/dev/test.html

(works in firefox, but not in internet explorer).

also, the webpage doesn't validate because, i guess, the dns's used by
the w3c validation services aren't up-to-date and still show a generic
page.
Jul 23 '05 #1
5 5303
yawnmoth wrote:
onmouseover and onmouseout seem only to work half the time in a script
i wrote to fade between different opacities:

http://www.frostjedi.com/terra/dev/test.html

(works in firefox, but not in internet explorer).

also, the webpage doesn't validate because, i guess, the dns's used by
the w3c validation services aren't up-to-date and still show a generic
page.


the function relies on a value "object.sourceIndex" to differentiate
between the two different elements. this evaluates to "undefined" in
firefox 1.0.

Kae
Jul 23 '05 #2
On 5 Dec 2004 18:54:28 -0800, yawnmoth <te*******@yahoo.com> wrote:
onmouseover and onmouseout seem only to work half the time in a script i
wrote to fade between different opacities:

http://www.frostjedi.com/terra/dev/test.html

(works in firefox, but not in internet explorer).
I believe it's a bug. Simple as that. I made my own version of your script
(which "works"[1] in all browsers, by the way) and noticed that when the
opacity level reaches 100%, there is a brief flicker (though it doesn't
happen in IE). If the maximum value is reduced to 99%, this flicker
doesn't occur and the mouseout event fires normally.

On the demo page at
<URL:http://www.mlwinter.pwp.blueyonder.co.uk/clj/yawnmoth/fade.html>, the
W3C image will go to 100% and the Firefox image to 99% (I've commented out
the line which limits the maximum to 99 for this test). Hopefully you'll
observe the difference.

To address the issue Kae mentioned (which I also noticed), the script uses
a hash table using the object references as the key and timer id as the
value.
also, the webpage doesn't validate because, i guess, the dns's used by
the w3c validation services aren't up-to-date and still show a generic
page.


It does now. In any case, the mark-up I used is Strict. You should note
that all modern pages should be written to the Strict DTD. The
Transitional DTD was only a temporary measure so that legacy pages could
be considered valid[2].

Mike
[1] Meaning: does something sensible. If the techniques attempted are
supported you'll have your fading images. If not, nothing visible will
happen and there will be no errors. Currently, IE6 and Gecko-based
browsers perform the fade.

[2] That's my hypothesis but I've seen others in HTML groups share the
same view.

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #3

Michael Winter wrote:
On 5 Dec 2004 18:54:28 -0800, yawnmoth <te*******@yahoo.com> wrote:

<snip>

I believe it's a bug. Simple as that. I made my own version of your script (which "works"[1] in all browsers, by the way) and noticed that when the opacity level reaches 100%, there is a brief flicker (though it doesn't happen in IE). If the maximum value is reduced to 99%, this flicker
doesn't occur and the mouseout event fires normally.

On the demo page at
<URL:http://www.mlwinter.pwp.blueyonder.co.uk/clj/yawnmoth/fade.html>,
the W3C image will go to 100% and the Firefox image to 99% (I've commented out the line which limits the maximum to 99 for this test). Hopefully you'll observe the difference.

To address the issue Kae mentioned (which I also noticed), the script uses a hash table using the object references as the key and timer id as the value.

<snip>

It does now. In any case, the mark-up I used is Strict. You should note that all modern pages should be written to the Strict DTD. The
Transitional DTD was only a temporary measure so that legacy pages could be considered valid[2].

Mike
[1] Meaning: does something sensible. If the techniques attempted are supported you'll have your fading images. If not, nothing visible will happen and there will be no errors. Currently, IE6 and Gecko-based
browsers perform the fade.

[2] That's my hypothesis but I've seen others in HTML groups share the same view.


Wow - that was a great post! Thanks! :D

I haven't yet looked at the code in as thorough detail as I'd like to,
but based on what I have seen, support for more browsers should be
do'able by adding the CSS attributes -moz-opacity and -khtml-opacity.
Unfortunately, doing this will prevent the CSS from validating (I
noticed you used IE's commenting system to prevent that part of the CSS
from being validated), but short of defining them in an onload
function, or something, I'm not sure what can really be done about
that. Anyway, adding support for those should be easy enough, if I
decide to do it :)

With regard to Strict vs. Transitional - the webpage I intend on using
this script on is XHTML 1.1 compliant (which, I think, is Strict by
default), but I hadn't considered doing it for the testpage. I'll keep
that in mind for future posts. Thanks! :)

Jul 23 '05 #4
On 7 Dec 2004 14:06:40 -0800, yawnmoth <te*******@yahoo.com> wrote:

[snip]
Wow - that was a great post! Thanks! :D
You're welcome. It was interesting.
I haven't yet looked at the code in as thorough detail as I'd like to,
but based on what I have seen, support for more browsers should be
do'able by adding the CSS attributes -moz-opacity and -khtml-opacity.
It is, but it will also require script changes: changing the opacity
property won't have any effect on either of the other two. So, I've
modified the script to determine which property is actually in effect.
It's not been used on the demo page, but you can download it from
<URL:http://www.mlwinter.pwp.blueyonder.co.uk/clj/yawnmoth/fade-new.js>.
Testing shows that all versions from Mozilla 1.0 onwards now fade but
unfortunately, earlier versions still exhibit the original sticking
problem.

I've added a few more comments to the new version, but if you have any
questions, just ask.
Unfortunately, doing this will prevent the CSS from validating
I don't think CSS validation is as important as mark-up validation. As
long as the syntax is correct and the errors are only due to unrecognised
properties (which will be ignored), then everything should be fine.
(I noticed you used IE's commenting system to prevent that part of the
CSS from being validated),
IE's filters might be treated as more than just an unrecognised property
name. The validator certainly thinks so.
but short of defining them in an onload function, or something, I'm not
sure what can really be done about that.
Not much, if anything.
Anyway, adding support for those should be easy enough, if I decide to
do it :)
Well, yeah. I did it for you! :P
With regard to Strict vs. Transitional [...] I hadn't considered doing
it for the testpage. I'll keep that in mind for future posts. Thanks!
:)


It's not a big deal for test pages. I thought you intended to use
Transitional mark-up on a production page; lots of people do. However,
there's no harm in writing to a Strict DTD for both.

Good luck with this,
Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #5

Michael Winter wrote:
On 7 Dec 2004 14:06:40 -0800, yawnmoth <te*******@yahoo.com> wrote:

[snip]

Well, yeah. I did it for you! :P
And you probably did a better job than I could have done on my own,
heh.

Anyway, I've learned a bit from your code, already, so hopefully next
time I won't need to ask for help (or if I do, it won't be as much help
as I would have otherwise needed) :)
Good luck with this,


Thanks! :)

Jul 23 '05 #6

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

Similar topics

7
by: Eqbal Z | last post by:
Hi, I have the following code, and onmouseover/onmouseout etc. does not work in netscape 4.7. <div id="divUpControl"><a href="javascript:void(0);" onMouseOver="PerformScroll(-7);"...
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. ...
6
by: Thomas Jansen | last post by:
Hi, I have trouble with <DIV> tags and IE6. I use several <DIV> tags in a table to create a menu (see code below) The first cell works like expected, when the mouse enters the box the background...
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...
6
by: bzi999 | last post by:
Hi! I'm having a strange problem with javascript and maybe someone herecan help me. Look at this simple html snippet: <div id="menu"> <img src="images/m1.gif" usemap='#map' border=0> <MAP...
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....
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
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...

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.