Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #16551 > unrolled thread
| Started by | joe <mt@invalid.com> |
|---|---|
| First post | 2012-10-11 14:31 +0300 |
| Last post | 2012-10-11 13:20 -0700 |
| Articles | 3 — 3 participants |
Back to article view | Back to comp.lang.javascript
How do I get the list item cursor is over joe <mt@invalid.com> - 2012-10-11 14:31 +0300
Re: How do I get the list item cursor is over Scott Sauyet <scott.sauyet@gmail.com> - 2012-10-11 06:48 -0700
Re: How do I get the list item cursor is over Danny <dann90038@gmail.com> - 2012-10-11 13:20 -0700
| From | joe <mt@invalid.com> |
|---|---|
| Date | 2012-10-11 14:31 +0300 |
| Subject | How do I get the list item cursor is over |
| Message-ID | <j4bd78p8mlkdo143tgvt43so0l42e93fvo@4ax.com> |
I have a list like below: <ul> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> <ul> Let's say my cursor is over "Item 2". I'd like to know using javascript that I'm over a particular item. I know about onmouseover/onmouseleave etc. but is there another event-less way?
[toc] | [next] | [standalone]
| From | Scott Sauyet <scott.sauyet@gmail.com> |
|---|---|
| Date | 2012-10-11 06:48 -0700 |
| Message-ID | <063d5dad-3fda-4a1e-87d7-45aa313e2bc4@g4g2000yqk.googlegroups.com> |
| In reply to | #16551 |
joe wrote: > I have a list like below: > > <ul> > <li>Item 1</li> > <li>Item 2</li> > <li>Item 3</li> > <ul> > > Let's say my cursor is over "Item 2". > I'd like to know using javascript that I'm over a particular item. I know about > onmouseover/onmouseleave etc. but is there another event-less way? What would that even mean? "my cursor is over" isn't itself an event, but presumably it was preceded by an event of the sort "my cursor moved over". Basically the interaction of the user with the document is a series of events that you can listen for. That's how it works. If you like, you can write a layer that abstracts some of that, for instance something that pays attention to the mouse movement and stores the currently hovered list item (or undefined) in some known location, e.g. a global variable Then other code can simply check that location to find which, if any, list item is hovered. But that doesn't mean that you're not using the events. -- Scott
[toc] | [prev] | [next] | [standalone]
| From | Danny <dann90038@gmail.com> |
|---|---|
| Date | 2012-10-11 13:20 -0700 |
| Message-ID | <3ddb89f9-7a95-408c-a82f-e713a1df217b@googlegroups.com> |
| In reply to | #16551 |
is there a way to listen to 'pointer movement' over any part of the page and get whatever is being underneath it? yes, though I'm not sure you even need that as Scott said, so give us less ambiguity that way we can address the matter in a more specific way :)
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.javascript
csiph-web