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

cancel out a default cell selection behaviour

P: n/a
Hi.

Let's say I have a 12 x 12 table.

I have enable mouse dragging over the cells.

But whenever I mouseover and select a cell,

the whole row of cells will be hightlighted in blue. (Aka the default
behaviour of text selection in a table)

Any ways to cancel out that behavour?

Thanks

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Feb 4 '07 #1
Share this Question
Share on Google+
3 Replies

P: n/a
Eric Layman wrote:
Any ways to cancel out that behavour?
<table onselectstart="return false;"
onmousedown="if (typeof event.preventDefault != 'undefined') {
event.preventDefault();
}"

--

Martin Honnen
http://JavaScript.FAQTs.com/
Feb 4 '07 #2

P: n/a

"Martin Honnen" <ma*******@yahoo.dewrote in message
news:45**********************@newsspool3.arcor-online.net...
Eric Layman wrote:
>Any ways to cancel out that behavour?

<table onselectstart="return false;"
onmousedown="if (typeof event.preventDefault != 'undefined') {
event.preventDefault();
}"

--

Martin Honnen
http://JavaScript.FAQTs.com/
Thanks Martin!

Didn't know "onselectstart" exists!

It worked!

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Feb 4 '07 #3

P: n/a
On Feb 5, 7:49 pm, "Eric Layman" <erricson@layswrote:
"Martin Honnen" <mahotr...@yahoo.dewrote in message

news:45**********************@newsspool3.arcor-online.net...
Eric Layman wrote:
Any ways to cancel out that behavour?
<table onselectstart="return false;"
onmousedown="if (typeof event.preventDefault != 'undefined') {
event.preventDefault();
}"
--
Martin Honnen
http://JavaScript.FAQTs.com/

Thanks Martin!

Didn't know "onselectstart" exists!
It is an IE proprietary intrinsic event[1], hence the onmousedown
handler for those browsers that don't implement it but do use the
W3C's preventDefault[2]. Those that support both (if there are any)
will get belt and braces.
1. <URL: http://msdn.microsoft.com/workshop/a...tml/reference/
events/onselectstart.asp >

2. <URL: http://www.w3.org/TR/DOM-Level-2-Eve...s.html#Events-
Event-preventDefault >
--
Rob

Feb 5 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.