locked out of .style.cursor changes

C

Csaba2000

The following code has me so confused, I don't even know
the right questions to ask. Opera 7.01 and IE 5.5 both
exhibit behaviours I don't understand while NN 6.1 seems
to ignore me altogether.

The upshot: .style.cursor seems to be ignored under
certain circumstances.

Let's take something that's mostly repeatable and maybe
someone can explain to me what's happening. In Opera 7.01
starting from the outside of the table shown, move the mouse,
slowly, left, enter the bottom border (from the bottom right
of the table) always moving left, and staying on the bottom border.

What I imagined should happen is that we should get a
single onmouseover event followed by a bunch of
onmousemove events. Indeed, near as I could tell, that's
what happens, but just in case, window.doneP=false
enforces this when coupled with if (window.doneP) return;

My observed behaviour is that the cursor changes to
what is set in the onmouseover event handler, but
not to what is set in the onmousemove handler, till
it is jostled off the bottom border. It's almost as if the
cursor is allowed to change only once per the element
becoming active.

I've been staring at what IE is doing for hours, but I
can't get consistent enough behaviour to report properly.
It'd be great if someone could offer some comments
about this.

Thanks,
Csaba Gabor from New York

PS. The motivation on this is that I'm going to want to
change the cursor to a hand when the cursor is over any
part of the (internal or external) table border that is NOT
at the intersection of two borders (ie. the little squares
where a horizontal and vertical border come together are
not allowed since there the border verticalness or
horizontalness is not uniquely determined). I'm able
to determine these locations quite nicely (thanks Richard),
but the cursors are not always changing as assigned.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD>
<META http-equiv="content-type" content="text/html;charset=iso-8859-1">
<TITLE>Opera Cursor issue demo</TITLE>
<SCRIPT type="text/javascript">
function statusBar (msg) {
document.getElementById("statusBar").innerText = msg; }
function setCur() {
// done with setTimeout just in case timing is involved.
aTables = document.getElementsByTagName("TABLE");
aTables[0].style.cursor="s-resize";
}
function mouseOver(elem) {
statusBar('MouseOver');
if (window.doneP) return;
window.doneP=true;
elem.style.cursor='hand';
}
</SCRIPT>
</HEAD>
<BODY onLoad="window.doneP=false" bgcolor=gold style="margin:5%">
<TABLE border onmouseover="mouseOver(this)"
onmousemove="window.setTimeout('setCur()',50);statusBar('MouseMove');"
onmouseout="statusBar('Off table')">
<TR>
<TD>foo</TD>
<TD>bar</TD>
<TD rowspan=2>tall col</TD>
</TR><TR>
<TD rowspan=2>tall col 2</TD>
<TD colspan=2>middle Row</TD>
</TR><TR>
<TD>This is a lot of baz</TD>
<TD>frob</TD>
</TR>
</TABLE>
<BR><BR>
<SPAN id="statusBar" style="color:red"></SPAN>
</BODY>
</HTML>
 
C

Csaba2000

Nobody said:
You are going about this all wrong.

Possibly, but please pardon my skepticism. You are a
little short on convincing argument here. Though I will
appreciate it when I get my example working, I would
also like to understand the behaviour that I am observing.
Define classes for your table cells.
Hide and show borders as needed and define the cursor styles for each.

The behaviour of my cells seems correct, near as I can
make it out, and at the borders, the cells are not
receiving event notifications. At most the TR and upward
elements do. However, one might imagine setting
distinct classes for a given table, which are identical
except for the type of cursor. Instead of swapping
cursors for the table, one would swap classes.

But this is tantamount to what I'm already doing (although
it may well work, too), so we come back to the original
question: why isn't it working for me?

Possibly I don't under your meaning. An example
would be most helpful.
Add "fake" borders with margins if you want to balance out the presentation.

Whatever that means.


Csaba Gabor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top