Topic: get mouse location on image while mousemove (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=30337" title="Pages that link to Topic: get mouse location on image while mousemove (Page 1 of 1)" rel="nofollow" >Topic: get mouse location on image while mousemove <span class="small">(Page 1 of 1)</span>\

 
ninmonkeys
Bipolar (III) Inmate

From: mn
Insane since: May 2004

posted posted 06-17-2008 01:57

I have an image that I am creating with PHP and GD. It's composed of cells, so you can think of it like a table or calender. What I want is to show different tooltip text based on the cell that the mouse is hovering. I found a bunch of javascript tooltip samples, but they all only support one tooltip per element.

On mousemove, if I can get mouseX and mouseY, i can calculate what cell is being hovered. Knowing that I can grab that cell's text. So what I don't know is:

(1) How do I get mouse location on an image on mousemove?

All I found was related to image maps and clicking. Do I have to use an image map? ( Because I'd prefer being able to just hover without clicking. )

thanks,
--
monkey

(Edited by ninmonkeys on 06-17-2008 01:58)

poi
Paranoid (IV) Inmate

From: Norway
Insane since: Jun 2002

posted posted 06-17-2008 06:49

Using JavaScript for that is wrong. There are solutions to do that in an accessible way.

Are the cells simple axis aligned quads ? If so, you could probably use a UL LI with a title attribute per LI, and place the img underneath the UL, or as a background image if the image does actually provide any information per se. If the cells represent a regular grid and are in fact tabular data, then this is crying for a TABLE tag, again with the image underneath or as a background image.

Notice that the HTML 4, AREA tag has a nohref so that might do the trick as well and allow for complex shapes.

In the 3 solutions above, simply set the title attribute on the elements you want to have a tooltip.



Hope that helps,



(Edited by poi on 06-17-2008 07:02)

ninmonkeys
Bipolar (III) Inmate

From: mn
Insane since: May 2004

posted posted 06-17-2008 08:05

Are you saying don't get coordinates using javascript for accessibility reasons, or that its not possible at all?

If not, the table solution will work.

poi
Paranoid (IV) Inmate

From: Norway
Insane since: Jun 2002

posted posted 06-17-2008 09:20

For accessibility reasons.
Of course it's possible, and I'm sure such code snipets are littered here and in the FAQ.

What kind of data do your image represent ?

argo_navis
Obsessive-Compulsive (I) Inmate

From:
Insane since: Apr 2008

posted posted 06-17-2008 21:41

For fuck's sake... don't mind the above standards dictionary - he will not help you, he is too stuck into his own rules to the game
to see the match as a whole.

Check this, it should fit the bill. I haven't moved the images around too much, but it works, and it does exactly what you want to do.
(copy paste to your browser adress bar) http://www.beyondwonderland.com/knowledge/index.php

With this in mind, "gott sei dank", the Ozone Asylum is gone from my referrers.
Hence a sneak peak at the ever more crippled sink of all things miscommunication and pricky webdesign tips.

(Edited by argo_navis on 06-17-2008 21:42)

poi
Paranoid (IV) Inmate

From: Norway
Insane since: Jun 2002

posted posted 06-17-2008 22:16

I love you too.

I'd gladly agree, really, with your approach if only doing things right took longer than "getting shit done". But in my experience that's not even remotely the case.

argo_navis
Obsessive-Compulsive (I) Inmate

From:
Insane since: Apr 2008

posted posted 06-18-2008 12:38

That is not the problem at hands. Guy has a question. It's nice to document the standards, but what about you make
sure your answer his question first and foremost?

..You know, like.. the polite thing to do? Oh you don't know.

On my page, I'd gladly receive your technical tips : but I'd still filter them. That's as much a damn I give about your priceless experience.
Especially since I am discovering and documenting processes for a web agency IN ORDER to enforce standards.

When migrating from the old CMS to current technology is a ROI killer,
there is something called a "budget" - and there lies the difference between your high hopes and reality.

Besides, in pure software design terms, ever heard about a thing called evolution, and the need for regression in that process?
Keep looking straight ahead to neverland. I'll take care of the roadsides - much better to harvest, they make for more long
term returns actually, for all involved.

If the guy has sample code, his own way, and standards, everybody should be happy. Me? I hate to see
mad scientists assume they are professionals. They just tend to bomb things.

(Edited by argo_navis on 06-18-2008 12:40)

Suho1004
Maniac (V) Mad Librarian

From: Seoul, Korea
Insane since: Apr 2002

posted posted 06-18-2008 13:20

Face it, argo--deep down inside, you love us. That's why you just can't stay away.


___________________________
Suho: www.liminality.org | Cell 270 | Sig Rotator | the Fellowship of Sup

argo_navis
Obsessive-Compulsive (I) Inmate

From:
Insane since: Apr 2008

posted posted 06-18-2008 16:16

Suho, people like you yeah, I do. *Gives Suho a sloppy kiss*. But the sneak peaks are just that : checks at my referrers, sneak peak
to make sure of what and who, and back to life.

I love the web too. But my presence here this time around?

I said it and it was fun and important for me : the "Asylum ban" purged my referrers, thus, it pushed search engines to dissociate
this place from me. It will be great to show evolution and convolutions at work under the sole action of reality. Who was right?
Time will answer that. And time is on my side apparently..


I am doing a lot of referencing works, so at some point, I saw referrers from poi's site - which is also banned by me, or should be.
Because he may be good at doing one thing but you know what they say about specialisation? He doesn't even see the questions
anymore - that's no judgement. It plain irks me to see this kind of overtly biased answer - let him have all the tools AND the knowledge
and then he decides, THAT is developing for people.

I started wondering what the hell was on, and much to my amusement, the same old stuff was on. Wasted. Potential.

If I loved *you,* as *the Asylum* my partnership with Imedia and their... what? 160 customers and portals?
Of all kinds and sizes? Companies like medical multinational socorex, for one. Well, that partnership, since we turned
the company from bankrupt to positive incomes, in no time, and are rising... I'd have posted the job descriptions
over there in the outpatient counselling.

THAT. Or the job offers for DirectX development in medical imagery - for R&D I mean.

I'd have handed those, and the excellent paychecks and work conditions, over to one or another of the inmates.
Who? Inflated TP and his wonderful Asylum Flash tag? Young boy poi, gifted but permanently stuck in an eight year's old
mindset?

Nah... to each his own. Me returning? Only for intelligence's sake when it really becomes too stupid to be true,
but I've lost hope of promoting and spreading this quality around here a long time ago. Some people have ideas and create means.

....

Others require standards and rules.

WebShaman
Lunatic (VI) Mad Scientist

From: The Happy Hunting Grounds...
Insane since: Mar 2001

posted posted 06-18-2008 16:42

You done now, IMA?

Or do you have more slop and unnecessary comments to add to the stuff you spew out, every time you post in a thread?

Glad to see your life getting on, now why don't you just get on with actually participating in your wonderful existence instead of broadcasting every stinking detail of it to the ether?

And do you think that you could try to type something, without insulting at least one member of the Asylum while you are at it?

WebShaman | The keenest sorrow (and greatest truth) is to recognize ourselves as the sole cause of all our adversities.
- Sophocles

poi
Paranoid (IV) Inmate

From: Norway
Insane since: Jun 2002

posted posted 06-18-2008 16:52

Looks like someone forgot the saying by which we [used to] go here:

" Give a man a fish, feed him for a day. Teach a man to fish, feed him for a lifetime. "

Answering the wrong questions is not helping people.

... and sorry for polluting your referers. Will "fix" that tonigh.

Suho1004
Maniac (V) Mad Librarian

From: Seoul, Korea
Insane since: Apr 2002

posted posted 06-19-2008 11:33

Hmm. I cannot claim to understand everything that has been said... although I do sense bitterness. But I'll take sloppy kisses when I can get them. As I've always said, there just aren't enough sloppy kisses in the world.

OK, so I haven't always said that, but I think I'm going to start saying it from now on.

poi: Personally, I like this phrase: "Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." Someone had that in a sig, I think. Can't remember who...


___________________________
Suho: www.liminality.org | Cell 270 | Sig Rotator | the Fellowship of Sup

DL-44
Lunatic (VI) Inmate

From: under the bed
Insane since: Feb 2000

posted posted 06-19-2008 17:41
quote:

Suho1004 said:

there just aren't enough sloppy kisses in the world



(with apologies to ninmonkeys...)

If only I'd known you felt that way while you were here...

Suho1004
Maniac (V) Mad Librarian

From: Seoul, Korea
Insane since: Apr 2002

posted posted 06-20-2008 09:37

And to think of what I missed... the agony!


___________________________
Suho: www.liminality.org | Cell 270 | Sig Rotator | the Fellowship of Sup

Bugimus
Maniac (V) Mad Scientist

From: New California
Insane since: Mar 2000

posted posted 06-23-2008 18:05

TMI!!! TMI!!!

. . . : : . . Innervating Your Eyes & Mind : . . .

argo_navis
Obsessive-Compulsive (I) Inmate

From:
Insane since: Apr 2008

posted posted 06-24-2008 03:35
quote:

Answering the wrong questions is not helping people.



Assuming what the right question is is the opposite of helping customers. You can entice.
But his choice should not be yours. Picking the question you want to answer is a bias you introduce - based on ego,
"my way's the right way".

There's another moron who's done something like that when he attacked Iraq : after all,
he did it in everybody's best interest. But look at the dollar now. ...And don't even go there with quoting holy sources :
all you're defending here is your little ego and set of PERSONAL beliefs.

Instead, browershot your own personal site, compare it to others, and see how portable YOU really are. Not bad.
Can do better though. What about referencing and SEARCH ENGINE accessibility? www.p01.org commits 50% of all possible
sins in that regard, starting with a redirect (so your index page is basically bullshit to spiders,
which irks them as wasted www space, and there go your stats).


As good as you are at tiny scripts, as good as you THINK you are in broader software development terms,
nothing, short of being an asshole, entitles you to answer "you have to fish for trouts" when asked how to fish.

...

In general, people like you do not get hired by me because since we sell a comprehensive branding/technology package most of the time,
topped by the service and support, we don't want a monotask code monkey down the basement to yell at our customers how they MUST make their choices.

We favor less specialised, but more flexible people, because, you know...

...Specialisation is for insects.

And Web Shaman, I am sorry I wounded your ego when telling you to go to hell with your plugin for NeverWinter Nights a while before you
went on this campaign against me - sorry it causes grief to this day, your vengeance dance has never fooled me - for you will always read a post of mine eagerly,
have always done so. I've been tempted to answer your question with a single word, But it's not fair to mock your handicap. I pitty you - you sound old,
bitter, and helpless, as a general condition.

...
Suho, finally, what you call bitterness is disappointment, really.
Looking at this place with the cord detached, I see no direction. No leadership. And no purpose.
Which results in a casual relevant link from google about some coding or photoshop topics.

And to thousands of "sinked and stinky posts". Group hugs and one toymaker won't change this.

And over time, a stink becomes lifeless and sterile. Shit happens.

Happy web monkeying, but watch out for poi's advice, test it, and be ready to discard 20-30% of it as completely personal to him.

WebShaman
Lunatic (VI) Mad Scientist

From: The Happy Hunting Grounds...
Insane since: Mar 2001

posted posted 06-24-2008 08:53

Just walk away, IMA.

Just let it go, and walk away.

Do you think you can do that?

WebShaman | The keenest sorrow (and greatest truth) is to recognize ourselves as the sole cause of all our adversities.
- Sophocles

poi
Paranoid (IV) Inmate

From: Norway
Insane since: Jun 2002

posted posted 06-25-2008 10:19

What the hell ?! Poor man really lost touch with reality. Not sure which part I like the most : the one about IRAQ or the one about him not hiring people like me.

Anyway, ninmonkeys, do you still have problems with this tooltip thing ?
And sorry for the noise.



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu