By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,758 Members | 1,223 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,758 IT Pros & Developers. It's quick & easy.

locked out of .style.cursor changes

P: n/a
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);stat usBar('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>

Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Nobody" <no**@nope.net> wrote in message news:2u*******************@fe2.columbus.rr.com...
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
Jul 20 '05 #2

P: n/a

"Csaba2000" <ne**@CsabaGabor.com> wrote in message
news:bj********@dispatch.concentric.net...
| "Nobody" <no**@nope.net> wrote in message
news:2u*******************@fe2.columbus.rr.com...
|
| > 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?

You mistunderstand. I am advocating a script-less solution. No class
swapping at all. Simply give your cells different classes with different
cursors.

|
| 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.

That is the key. A border is part of an element and margins are not. So
you can make "fake" borders within your cells to mimic the actual cell
borders, yet have no special cursor. If you are trying to let the user
resize columns or something like that, just create dummy "grip" cells of
classes that use the "compass" style cursors. You will not have to use
script to change the cursor in any event.

After re-reading your original post, I see another problem. The "hand"
cursor style does not work on all browsers. Some want "pointer." I am
pretty sure Opera is in the group that breaks on "hand." (One more reason
to generate style sheets with an informed CGI script.)

|
|
| Csaba Gabor
|
|
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.