Forum Moderators: open

Message Too Old, No Replies

Drag Events in Mozilla/Netscape

         

glyph78

4:38 am on Jun 17, 2004 (gmt 0)

10+ Year Member



So I'm trying to make a grid of cells (think Excel-like) that will allow a user to select a range of cells by dragging. I've got it mostly working in IE6, but getting the drag events to behave properly in Mozilla/Netscape is really giving me a hard time. You can see the page here:

<snip>

Notice how (using IE) you can drag to select multiple cells (they become highlighted in red). Now try it in Netscape. As soon as you start to drag, the little circle/slash icon appears.

If this doesn't make sense, let me know and I'll try to describe it better. Really just think Excel - it's meant to function like cell selection in Excel functions.

Thanks for any help,

-Scott

[edited by: DrDoc at 1:37 pm (utc) on June 17, 2004]
[edit reason] No URLs, thanks. See TOS [webmasterworld.com] [/edit]

DrDoc

1:42 pm on Jun 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld!

Are you using anchors in the cells? If that's the case, the browser thinks that you want to drag the link. Could you accomplish the same without using anchor tags?

Otherwise you will have to play around with various on*** events. Still, it would be hard to get the browser not to think that you're trying to drag the link. Maybe you can change it to only work with the right mouse button?

glyph78

2:11 pm on Jun 17, 2004 (gmt 0)

10+ Year Member



Yes, currently I'm using anchor tags with display:block. But now that I think about it, there's really no reason not to use div's. The cells won't be linking to anywhere, they'll just be used as data. I'll give it a try as soon as I get home from work.

glyph78

3:39 am on Jun 18, 2004 (gmt 0)

10+ Year Member



DrDoc,

You are a stud. Works like a champ. Thanks!

-Scott

DrDoc

3:50 am on Jun 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Glad it worked for you ;) Sounds like a really neat solution